Documentation
¶
Index ¶
- func FormatIssue(issue *Issue) string
- func LoadToken() (*config.JiraToken, error)
- func SaveToken(token *config.JiraToken) error
- type Client
- func (c *Client) AddComment(ctx context.Context, issueKey string, body string) (*Comment, error)
- func (c *Client) CreateIssue(ctx context.Context, req CreateIssueRequest) (*Issue, error)
- func (c *Client) DeleteIssue(ctx context.Context, issueKey string, deleteSubtasks bool) error
- func (c *Client) EnsureAuth(ctx context.Context) error
- func (c *Client) FindUser(ctx context.Context, query string) ([]User, error)
- func (c *Client) GetCurrentUser(ctx context.Context) (*User, error)
- func (c *Client) GetIssue(ctx context.Context, issueKey string) (*Issue, error)
- func (c *Client) GetMyIssues(ctx context.Context, maxResults int) (*SearchResult, error)
- func (c *Client) GetProjectKeys(ctx context.Context) ([]string, error)
- func (c *Client) GetRecentIssues(ctx context.Context, maxResults int) (*SearchResult, error)
- func (c *Client) GetSiteURL() string
- func (c *Client) LinkIssues(ctx context.Context, req LinkIssuesRequest) error
- func (c *Client) ListLinkTypes(ctx context.Context) ([]IssueLinkType, error)
- func (c *Client) ListProjects(ctx context.Context) ([]Project, error)
- func (c *Client) ListTransitions(ctx context.Context, issueKey string) ([]Transition, error)
- func (c *Client) SearchIssues(ctx context.Context, jql string, maxResults int) (*SearchResult, error)
- func (c *Client) TransitionIssue(ctx context.Context, issueKey string, transitionNameOrID string) error
- func (c *Client) UpdateIssue(ctx context.Context, issueKey string, req UpdateIssueRequest) error
- type Comment
- type CreateIssueRequest
- type Issue
- type IssueLinkType
- type JiraSiteInfo
- type LinkIssuesRequest
- type OAuthFlow
- func (o *OAuthFlow) ExchangeCode(ctx context.Context, code string) (*config.JiraToken, error)
- func (o *OAuthFlow) GetAuthURL(state string) string
- func (o *OAuthFlow) GetSiteInfo(ctx context.Context, accessToken string) (*JiraSiteInfo, error)
- func (o *OAuthFlow) RefreshToken(ctx context.Context, refreshToken string) (*config.JiraToken, error)
- func (o *OAuthFlow) StartAuthServer(ctx context.Context) (*config.JiraToken, error)
- type Project
- type SearchResult
- type Transition
- type UpdateIssueRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIssue ¶
FormatIssue returns a formatted string representation of an issue
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddComment ¶ added in v0.27.0
AddComment adds a comment to an issue
func (*Client) CreateIssue ¶ added in v0.24.0
CreateIssue creates a new Jira issue
func (*Client) DeleteIssue ¶ added in v0.24.0
DeleteIssue deletes an issue by key. If deleteSubtasks is true, subtasks are also deleted.
func (*Client) EnsureAuth ¶
EnsureAuth ensures we have a valid token, refreshing or re-authenticating as needed
func (*Client) GetCurrentUser ¶ added in v0.3.0
GetCurrentUser fetches the authenticated user's info
func (*Client) GetMyIssues ¶
GetMyIssues fetches issues assigned to the current user
func (*Client) GetProjectKeys ¶
GetProjectKeys returns just the project keys (e.g., DEV, TEL)
func (*Client) GetRecentIssues ¶
GetRecentIssues fetches recently updated issues
func (*Client) GetSiteURL ¶
GetSiteURL returns the browsable Jira site URL (e.g., https://company.atlassian.net)
func (*Client) LinkIssues ¶ added in v0.26.0
func (c *Client) LinkIssues(ctx context.Context, req LinkIssuesRequest) error
LinkIssues creates a link between two issues
func (*Client) ListLinkTypes ¶ added in v0.26.0
func (c *Client) ListLinkTypes(ctx context.Context) ([]IssueLinkType, error)
ListLinkTypes returns all available issue link types
func (*Client) ListProjects ¶
ListProjects fetches all accessible Jira projects
func (*Client) ListTransitions ¶ added in v0.27.0
ListTransitions returns available transitions for an issue
func (*Client) SearchIssues ¶
func (c *Client) SearchIssues(ctx context.Context, jql string, maxResults int) (*SearchResult, error)
SearchIssues searches for issues using JQL
func (*Client) TransitionIssue ¶ added in v0.27.0
func (c *Client) TransitionIssue(ctx context.Context, issueKey string, transitionNameOrID string) error
TransitionIssue moves an issue to a new status
func (*Client) UpdateIssue ¶ added in v0.27.0
UpdateIssue updates an existing issue's fields
type CreateIssueRequest ¶ added in v0.24.0
type CreateIssueRequest struct {
ProjectKey string // Required: project key (e.g., "DEV")
IssueType string // Required: issue type (e.g., "Task", "Bug", "Story", "Sub-task")
Summary string // Required: issue summary/title
Description string // Optional: plain text description
Labels []string // Optional: labels to apply
Assignee string // Optional: account ID or email
Priority string // Optional: "Lowest", "Low", "Medium", "High", "Highest"
Parent string // Optional: parent issue key for subtasks (e.g., "DEV-123")
}
CreateIssueRequest contains the parameters for creating a new issue
type Issue ¶
type Issue struct {
ID string `json:"id"`
Key string `json:"key"`
Self string `json:"self"`
Fields struct {
Summary string `json:"summary"`
Description any `json:"description"`
Status struct {
Name string `json:"name"`
} `json:"status"`
IssueType struct {
Name string `json:"name"`
} `json:"issuetype"`
Priority struct {
Name string `json:"name"`
} `json:"priority"`
Assignee *struct {
DisplayName string `json:"displayName"`
EmailAddress string `json:"emailAddress"`
} `json:"assignee"`
Reporter *struct {
DisplayName string `json:"displayName"`
EmailAddress string `json:"emailAddress"`
} `json:"reporter"`
Created string `json:"created"`
Updated string `json:"updated"`
Labels []string `json:"labels"`
Parent *Issue `json:"parent"`
Subtasks []Issue `json:"subtasks"`
IssueLinks []struct {
ID string `json:"id"`
Type struct {
Name string `json:"name"`
Inward string `json:"inward"`
Outward string `json:"outward"`
} `json:"type"`
InwardIssue *struct {
Key string `json:"key"`
Fields struct {
Summary string `json:"summary"`
Status struct {
Name string `json:"name"`
} `json:"status"`
} `json:"fields"`
} `json:"inwardIssue"`
OutwardIssue *struct {
Key string `json:"key"`
Fields struct {
Summary string `json:"summary"`
Status struct {
Name string `json:"name"`
} `json:"status"`
} `json:"fields"`
} `json:"outwardIssue"`
} `json:"issuelinks"`
Comment *struct {
Comments []Comment `json:"comments"`
Total int `json:"total"`
} `json:"comment"`
} `json:"fields"`
}
type IssueLinkType ¶ added in v0.26.0
type IssueLinkType struct {
ID string `json:"id"`
Name string `json:"name"`
Inward string `json:"inward"`
Outward string `json:"outward"`
}
IssueLinkType represents a type of link between issues
type JiraSiteInfo ¶
JiraSiteInfo contains cloud ID and browsable site URL
type LinkIssuesRequest ¶ added in v0.26.0
type LinkIssuesRequest struct {
InwardIssue string // The issue that is the source of the link (e.g., "DEV-123")
OutwardIssue string // The issue that is the target of the link (e.g., "DEV-456")
LinkType string // The type of link (e.g., "Relates", "Blocks", "Duplicates")
}
LinkIssuesRequest contains the parameters for linking two issues
type OAuthFlow ¶
type OAuthFlow struct {
// contains filtered or unexported fields
}
func NewOAuthFlow ¶
func (*OAuthFlow) ExchangeCode ¶
ExchangeCode exchanges an authorization code for tokens
func (*OAuthFlow) GetAuthURL ¶
GetAuthURL returns the URL to start the OAuth flow
func (*OAuthFlow) GetSiteInfo ¶
GetSiteInfo fetches the Jira site info (CloudID and SiteURL) from the accessible-resources API
type Project ¶
type Project struct {
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
ProjectType string `json:"projectTypeKey"`
Self string `json:"self"`
}
Project represents a Jira project
type SearchResult ¶
type Transition ¶ added in v0.27.0
type Transition struct {
ID string `json:"id"`
Name string `json:"name"`
To struct {
Name string `json:"name"`
} `json:"to"`
}
Transition represents an available workflow transition
type UpdateIssueRequest ¶ added in v0.27.0
type UpdateIssueRequest struct {
Summary *string // New summary/title (nil = don't change)
Description *string // New description (nil = don't change)
Assignee *string // New assignee email or account ID (nil = don't change, empty string = unassign)
Priority *string // New priority name (nil = don't change)
AddLabels []string // Labels to add
RemoveLabels []string // Labels to remove
}
UpdateIssueRequest contains the parameters for updating an issue