Documentation
¶
Overview ¶
Package tracker reads tickets from the team's issue tracker (Jira).
It is read-only on purpose: okvault never posts to the tracker on a person's behalf. Credentials come from the environment, never from the vault.
Index ¶
Constants ¶
const ( EnvToken = "JIRA_API_TOKEN" // Cloud API token (with JIRA_EMAIL) or Data Center personal access token EnvEmail = "JIRA_EMAIL" // Cloud account email; when empty the token is sent as a bearer PAT )
Environment variables holding Jira credentials.
Variables ¶
var ErrNotConfigured = errors.New("tracker: not configured")
ErrNotConfigured means the vault has no fetchable tracker, or no credentials are set.
var ErrNotFound = errors.New("tracker: ticket not found")
ErrNotFound means the ticket does not exist or the credentials cannot see it.
Functions ¶
func Text ¶
func Text(raw json.RawMessage) string
Text converts a Jira rich-text field to plain text. REST v2 returns a string (wiki markup, kept as is); REST v3 returns an Atlassian Document Format (ADF) tree, which is flattened.
Types ¶
type Comment ¶
type Comment struct {
Author string `json:"author"`
Created string `json:"created"`
Body string `json:"body"`
}
Comment is a ticket comment, as plain text.
type Issue ¶
type Issue struct {
Key string `json:"key"`
URL string `json:"url,omitempty"`
Summary string `json:"summary"`
Type string `json:"type,omitempty"`
Status string `json:"status,omitempty"`
Category string `json:"status_category,omitempty"` // To Do, In Progress, Done
Priority string `json:"priority,omitempty"`
Assignee string `json:"assignee,omitempty"`
Reporter string `json:"reporter,omitempty"`
Labels []string `json:"labels,omitempty"`
Parent string `json:"parent,omitempty"`
Updated string `json:"updated,omitempty"`
Description string `json:"description,omitempty"` // plain text, truncated
Comments []Comment `json:"recent_comments,omitempty"`
}
Issue is a compact view of a ticket.
type Jira ¶
type Jira struct {
// contains filtered or unexported fields
}
Jira is a read-only Jira Cloud (REST v3) or Data Center (REST v2) client.