api

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ID       string `json:"id"`
	Filename string `json:"filename"`
	Size     int64  `json:"size"`
	MimeType string `json:"mimeType,omitempty"`
	Created  string `json:"created,omitempty"`
	Author   *User  `json:"author,omitempty"`
	Content  string `json:"content,omitempty"`
}

type Client

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

func NewClient

func NewClient(cfg *config.Config) *Client

func (*Client) AddAttachment

func (c *Client) AddAttachment(issueKey, filePath string, filename string) ([]Attachment, error)

func (*Client) AddComment

func (c *Client) AddComment(issueKey string, adfBody map[string]interface{}) (*Comment, error)

func (*Client) AddCommentWiki

func (c *Client) AddCommentWiki(issueKey string, wikiBody string) (*Comment, error)

AddCommentWiki adds a comment using the v2 REST API, which accepts wiki markup as a plain string body. This is needed for inline image support (!filename!).

func (*Client) BaseURL

func (c *Client) BaseURL() string

func (*Client) CreateIssue

func (c *Client) CreateIssue(projectKey, summary, issueType string, description map[string]interface{}, priority, assignee string, labels []string, dueDate, parentKey string) (*Issue, error)
func (c *Client) CreateIssueLink(linkTypeName, inwardIssueKey, outwardIssueKey string) error

func (*Client) CreateIssueWiki

func (c *Client) CreateIssueWiki(projectKey, summary, issueType string, description string, priority, assignee string, labels []string, dueDate, parentKey string) (*Issue, error)

CreateIssueWiki creates an issue using the v2 REST API, which accepts wiki markup for text fields like description. This is needed for inline image support (!filename!).

func (*Client) DeleteComment

func (c *Client) DeleteComment(issueKey, commentID string) error

func (*Client) DeleteIssue

func (c *Client) DeleteIssue(issueKey string, deleteSubtasks bool) error
func (c *Client) DeleteIssueLink(linkID string) error

func (*Client) GetAssignableUsers

func (c *Client) GetAssignableUsers(projectKey string, maxResults int) ([]User, error)

func (*Client) GetComments

func (c *Client) GetComments(issueKey string, maxResults int) (*CommentPage, error)

func (*Client) GetIssue

func (c *Client) GetIssue(issueKey string, fields []string, expand []string) (*Issue, error)

func (*Client) GetIssueLinkTypes

func (c *Client) GetIssueLinkTypes() ([]IssueLinkType, error)
func (c *Client) GetIssueLinks(issueKey string) ([]IssueLink, error)

func (*Client) GetIssueTypes

func (c *Client) GetIssueTypes() ([]IssueType, error)

func (*Client) GetMyself

func (c *Client) GetMyself() (*User, error)

func (*Client) GetPriorities

func (c *Client) GetPriorities() ([]Priority, error)

func (*Client) GetProject

func (c *Client) GetProject(projectKey string) (map[string]interface{}, error)

func (*Client) GetProjects

func (c *Client) GetProjects(maxResults int) ([]Project, error)

func (*Client) GetStatuses

func (c *Client) GetStatuses(projectKey string) ([]map[string]interface{}, error)

func (*Client) GetTransitions

func (c *Client) GetTransitions(issueKey string) ([]Transition, error)

func (*Client) SearchIssues

func (c *Client) SearchIssues(jql string, fields []string, maxResults int, nextPageToken string) (*SearchResult, error)

func (*Client) SearchUsers

func (c *Client) SearchUsers(query string, maxResults int) ([]User, error)

func (*Client) TransitionIssue

func (c *Client) TransitionIssue(issueKey, transitionID string) error

func (*Client) UpdateComment

func (c *Client) UpdateComment(issueKey, commentID string, adfBody map[string]interface{}) (*Comment, error)

func (*Client) UpdateCommentWiki

func (c *Client) UpdateCommentWiki(issueKey, commentID string, wikiBody string) (*Comment, error)

UpdateCommentWiki updates a comment using the v2 REST API, which accepts wiki markup as a plain string body. This is needed for inline image support (!filename!).

func (*Client) UpdateIssue

func (c *Client) UpdateIssue(issueKey string, fields map[string]interface{}) error

func (*Client) UpdateIssueWiki

func (c *Client) UpdateIssueWiki(issueKey string, fields map[string]interface{}) error

UpdateIssueWiki updates an issue using the v2 REST API, which accepts wiki markup for text fields like description. This is needed for inline image support (!filename!).

type Comment

type Comment struct {
	ID      string                 `json:"id"`
	Author  *User                  `json:"author,omitempty"`
	Body    map[string]interface{} `json:"body,omitempty"`
	Created string                 `json:"created,omitempty"`
	Updated string                 `json:"updated,omitempty"`
}

type CommentPage

type CommentPage struct {
	Comments   []Comment `json:"comments"`
	MaxResults int       `json:"maxResults"`
	Total      int       `json:"total"`
	StartAt    int       `json:"startAt"`
}

type Issue

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

type IssueFields

type IssueFields struct {
	Summary     string                 `json:"summary"`
	Description map[string]interface{} `json:"description,omitempty"`
	Status      *Status                `json:"status,omitempty"`
	Priority    *Priority              `json:"priority,omitempty"`
	IssueType   *IssueType             `json:"issuetype,omitempty"`
	Assignee    *User                  `json:"assignee,omitempty"`
	Reporter    *User                  `json:"reporter,omitempty"`
	Created     string                 `json:"created,omitempty"`
	Updated     string                 `json:"updated,omitempty"`
	DueDate     string                 `json:"duedate,omitempty"`
	Labels      []string               `json:"labels,omitempty"`
	Project     *Project               `json:"project,omitempty"`
	Comment     *CommentPage           `json:"comment,omitempty"`
	Parent      *Issue                 `json:"parent,omitempty"`
}
type IssueLink struct {
	ID           string         `json:"id"`
	Type         *IssueLinkType `json:"type,omitempty"`
	InwardIssue  *Issue         `json:"inwardIssue,omitempty"`
	OutwardIssue *Issue         `json:"outwardIssue,omitempty"`
}

type IssueLinkType

type IssueLinkType struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Inward  string `json:"inward"`
	Outward string `json:"outward"`
}

type IssueType

type IssueType struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Priority

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

type Project

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

type SearchResult

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

type Status

type Status struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Transition

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

type User

type User struct {
	AccountID   string `json:"accountId"`
	DisplayName string `json:"displayName"`
	Email       string `json:"emailAddress,omitempty"`
	Active      bool   `json:"active,omitempty"`
}

Jump to

Keyboard shortcuts

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