jira

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Jira REST API v2 client.

func NewClient

func NewClient(cfg *config.AtlassianConfig) *Client

NewClient creates a new Client from the given configuration.

func (*Client) AddComment

func (c *Client) AddComment(ctx context.Context, key, body string) (*Comment, error)

func (*Client) BaseURL

func (c *Client) BaseURL() string

func (*Client) CreateIssue

func (c *Client) CreateIssue(ctx context.Context, input *CreateIssueInput) (*Issue, error)

func (*Client) DeleteIssue

func (c *Client) DeleteIssue(ctx context.Context, key string) error

func (*Client) GetIssue

func (c *Client) GetIssue(ctx context.Context, key string) (*Issue, error)

func (*Client) GetMyself

func (c *Client) GetMyself(ctx context.Context) (*User, error)

func (*Client) GetSubtasks

func (c *Client) GetSubtasks(ctx context.Context, key string) ([]Issue, error)

func (*Client) GetTransitions

func (c *Client) GetTransitions(ctx context.Context, key string) ([]Transition, error)

func (*Client) ListComments

func (c *Client) ListComments(ctx context.Context, key string) ([]Comment, error)

func (*Client) SearchIssues

func (c *Client) SearchIssues(ctx context.Context, jql string, maxResults int) (*SearchResult, error)

func (*Client) TransitionIssue

func (c *Client) TransitionIssue(ctx context.Context, key, statusName string) error

func (*Client) UpdateIssue

func (c *Client) UpdateIssue(ctx context.Context, key string, fields map[string]any) error

type Comment

type Comment struct {
	ID      string `json:"id"`
	Author  *User  `json:"author"`
	Body    string `json:"body"`
	Created string `json:"created"`
	Updated string `json:"updated"`
}

Comment represents a comment on a Jira issue.

type CreateIssueInput

type CreateIssueInput struct {
	ProjectKey   string         `json:"projectKey"`
	Summary      string         `json:"summary"`
	IssueType    string         `json:"issueType"`
	Description  string         `json:"description,omitempty"`
	Assignee     string         `json:"assignee,omitempty"`
	Priority     string         `json:"priority,omitempty"`
	Labels       []string       `json:"labels,omitempty"`
	CustomFields map[string]any `json:"customFields,omitempty"`
}

CreateIssueInput holds the parameters for creating a new Jira issue.

type Issue

type Issue struct {
	ID     string      `json:"id"`
	Key    string      `json:"key"`
	Self   string      `json:"self"`
	Fields IssueFields `json:"fields"`
}

Issue represents a Jira issue with its key and fields.

type IssueFields

type IssueFields struct {
	Summary     string     `json:"summary"`
	Description string     `json:"description"`
	Status      *Status    `json:"status"`
	IssueType   *IssueType `json:"issuetype"`
	Priority    *Priority  `json:"priority"`
	Assignee    *User      `json:"assignee"`
	Reporter    *User      `json:"reporter"`
	Project     *Project   `json:"project"`
	Created     string     `json:"created"`
	Updated     string     `json:"updated"`
	Labels      []string   `json:"labels"`
	Subtasks    []Issue    `json:"subtasks"`
}

type IssueType

type IssueType struct {
	Self        string `json:"self"`
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Subtask     bool   `json:"subtask"`
}

type Priority

type Priority struct {
	Self string `json:"self"`
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Project

type Project struct {
	Self string `json:"self"`
	ID   string `json:"id"`
	Key  string `json:"key"`
	Name string `json:"name"`
}

type SearchResult

type SearchResult struct {
	StartAt    int     `json:"startAt"`
	MaxResults int     `json:"maxResults"`
	Total      int     `json:"total"`
	Issues     []Issue `json:"issues"`
}

SearchResult holds a paginated list of issues returned by a JQL query.

type Status

type Status struct {
	Self        string `json:"self"`
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Transition

type Transition struct {
	ID   string  `json:"id"`
	Name string  `json:"name"`
	To   *Status `json:"to"`
}

type User

type User struct {
	Self         string `json:"self"`
	AccountID    string `json:"accountId"`
	EmailAddress string `json:"emailAddress"`
	DisplayName  string `json:"displayName"`
	Active       bool   `json:"active"`
	TimeZone     string `json:"timeZone"`
}

User represents a Jira user account.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL