Documentation
¶
Index ¶
- func FormatIssue(issue *Issue) string
- func LoadToken() (*config.JiraToken, error)
- func SaveToken(token *config.JiraToken) error
- type Client
- 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) ListProjects(ctx context.Context) ([]Project, error)
- func (c *Client) SearchIssues(ctx context.Context, jql string, maxResults int) (*SearchResult, error)
- type Comment
- type CreateIssueRequest
- type Issue
- type JiraSiteInfo
- 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 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) 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) ListProjects ¶
ListProjects fetches all accessible Jira projects
func (*Client) SearchIssues ¶
func (c *Client) SearchIssues(ctx context.Context, jql string, maxResults int) (*SearchResult, error)
SearchIssues searches for issues using JQL
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 JiraSiteInfo ¶
JiraSiteInfo contains cloud ID and browsable site URL
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