Documentation
¶
Index ¶
- type AtlassianTime
- type Attachment
- type AvatarUrls
- type BatchCreateIssuesRequest
- type BatchCreateIssuesResponse
- type BatchError
- type Board
- type Changelog
- type ChangelogItem
- type Client
- func (c *Client) AddAttachment(ctx context.Context, issueKey string, filename string, content []byte) (*Attachment, error)
- func (c *Client) AddComment(ctx context.Context, issueKey string, body string, visibility *Visibility) (*Comment, error)
- func (c *Client) AddWorklog(ctx context.Context, issueKey string, req *CreateWorklogRequest) (*Worklog, error)
- func (c *Client) ArchiveVersion(ctx context.Context, versionID string) (*Version, error)
- func (c *Client) AssignIssue(ctx context.Context, issueKey string, accountID string) error
- func (c *Client) BatchCreateIssues(ctx context.Context, issuesFields []map[string]interface{}) (*BatchCreateIssuesResponse, error)
- func (c *Client) BatchCreateVersions(ctx context.Context, versions []*CreateVersionRequest) ([]Version, error)
- func (c *Client) BatchGetChangelogs(ctx context.Context, issueKeys []string) (map[string][]Changelog, error)
- func (c *Client) CloseSprint(ctx context.Context, sprintID int) (*Sprint, error)
- func (c *Client) CreateIssue(ctx context.Context, fields map[string]interface{}) (*Issue, error)
- func (c *Client) CreateIssueLink(ctx context.Context, linkType IssueLinkType, inwardIssue, outwardIssue string, ...) (*IssueLink, error)
- func (c *Client) CreateIssueLinkByName(ctx context.Context, linkTypeName, inwardIssue, outwardIssue string, ...) (*IssueLink, error)
- func (c *Client) CreateRemoteLink(ctx context.Context, issueKey string, link *RemoteLink) (*RemoteLink, error)
- func (c *Client) CreateSprint(ctx context.Context, req *CreateSprintRequest) (*Sprint, error)
- func (c *Client) CreateVersion(ctx context.Context, req *CreateVersionRequest) (*Version, error)
- func (c *Client) DeleteAttachment(ctx context.Context, attachmentID string) error
- func (c *Client) DeleteComment(ctx context.Context, issueKey string, commentID string) error
- func (c *Client) DeleteIssue(ctx context.Context, issueKey string, deleteSubtasks bool) error
- func (c *Client) DeleteIssueLink(ctx context.Context, linkID string) error
- func (c *Client) DeleteRemoteLink(ctx context.Context, issueKey string, linkID string) error
- func (c *Client) DeleteSprint(ctx context.Context, sprintID int) error
- func (c *Client) DeleteVersion(ctx context.Context, versionID string, ...) error
- func (c *Client) DeleteWorklog(ctx context.Context, issueKey string, worklogID string) error
- func (c *Client) DownloadAttachment(ctx context.Context, attachmentURL string) ([]byte, error)
- func (c *Client) DownloadAttachmentContent(ctx context.Context, attachment *Attachment) ([]byte, error)
- func (c *Client) FindAssignableUsers(ctx context.Context, project, issueKey, query string, maxResults int) ([]User, error)
- func (c *Client) GetAllFields(ctx context.Context) ([]Field, error)
- func (c *Client) GetAllProjects(ctx context.Context, opts *GetProjectsOptions) ([]Project, error)
- func (c *Client) GetAttachment(ctx context.Context, attachmentID string) (*Attachment, error)
- func (c *Client) GetAttachmentMetadata(ctx context.Context, attachmentID string) (*Attachment, error)
- func (c *Client) GetAttachments(ctx context.Context, issueKey string) ([]Attachment, error)
- func (c *Client) GetBacklogIssues(ctx context.Context, boardID int, opts *SearchOptions) (*SearchResult, error)
- func (c *Client) GetBoard(ctx context.Context, boardID int) (*Board, error)
- func (c *Client) GetBoardIssues(ctx context.Context, boardID int, opts *SearchOptions) (*SearchResult, error)
- func (c *Client) GetBoardSprints(ctx context.Context, boardID int, state string) ([]Sprint, error)
- func (c *Client) GetBoards(ctx context.Context, opts *GetBoardsOptions) ([]Board, error)
- func (c *Client) GetChangelogs(ctx context.Context, issueKey string) ([]Changelog, error)
- func (c *Client) GetComment(ctx context.Context, issueKey string, commentID string) (*Comment, error)
- func (c *Client) GetComments(ctx context.Context, issueKey string) ([]Comment, error)
- func (c *Client) GetCurrentUser(ctx context.Context) (*User, error)
- func (c *Client) GetCustomFields(ctx context.Context) ([]Field, error)
- func (c *Client) GetDeploymentType() DeploymentType
- func (c *Client) GetEpicLinkField(ctx context.Context) (*Field, error)
- func (c *Client) GetEssentialFields() []string
- func (c *Client) GetFieldByKey(ctx context.Context, key string) (*Field, error)
- func (c *Client) GetFieldByName(ctx context.Context, name string) (*Field, error)
- func (c *Client) GetIssue(ctx context.Context, issueKey string, opts *GetIssueOptions) (*Issue, error)
- func (c *Client) GetIssueLink(ctx context.Context, linkID string) (*IssueLink, error)
- func (c *Client) GetIssueLinkTypes(ctx context.Context) ([]IssueLinkType, error)
- func (c *Client) GetProject(ctx context.Context, projectKey string, expand []string) (*Project, error)
- func (c *Client) GetProjectComponents(ctx context.Context, projectKey string) ([]Component, error)
- func (c *Client) GetProjectIssueTypes(ctx context.Context, projectKey string) ([]IssueType, error)
- func (c *Client) GetProjectIssues(ctx context.Context, projectKey string, opts *SearchOptions) (*SearchResult, error)
- func (c *Client) GetProjectVersions(ctx context.Context, projectKey string) ([]Version, error)
- func (c *Client) GetRemoteLinks(ctx context.Context, issueKey string) ([]RemoteLink, error)
- func (c *Client) GetSprint(ctx context.Context, sprintID int) (*Sprint, error)
- func (c *Client) GetSprintIssues(ctx context.Context, sprintID int, opts *SearchOptions) (*SearchResult, error)
- func (c *Client) GetStoryPointsField(ctx context.Context) (*Field, error)
- func (c *Client) GetTransitionByName(ctx context.Context, issueKey string, transitionName string) (*Transition, error)
- func (c *Client) GetTransitions(ctx context.Context, issueKey string) ([]Transition, error)
- func (c *Client) GetUser(ctx context.Context, accountIDOrUsername string) (*User, error)
- func (c *Client) GetUserGroups(ctx context.Context, accountIDOrUsername string) ([]string, error)
- func (c *Client) GetVersion(ctx context.Context, versionID string) (*Version, error)
- func (c *Client) GetWorklog(ctx context.Context, issueKey string, worklogID string) (*Worklog, error)
- func (c *Client) GetWorklogs(ctx context.Context, issueKey string) ([]Worklog, error)
- func (c *Client) IsCloud() bool
- func (c *Client) IsServer() bool
- func (c *Client) LinkToEpic(ctx context.Context, issueKey, epicKey string) error
- func (c *Client) MoveIssuesToSprint(ctx context.Context, sprintID int, issueKeys []string) error
- func (c *Client) ParseFieldList(ctx context.Context, fieldList string) ([]string, error)
- func (c *Client) ReleaseVersion(ctx context.Context, versionID string, releaseDate string) (*Version, error)
- func (c *Client) SearchFields(ctx context.Context, query string) ([]Field, error)
- func (c *Client) SearchIssues(ctx context.Context, jql string, opts *SearchOptions) (*SearchResult, error)
- func (c *Client) SearchProjects(ctx context.Context, query string, maxResults int) ([]Project, error)
- func (c *Client) SearchUsers(ctx context.Context, query string, maxResults int) ([]User, error)
- func (c *Client) StartSprint(ctx context.Context, sprintID int) (*Sprint, error)
- func (c *Client) TransitionIssue(ctx context.Context, issueKey string, transitionID string, ...) error
- func (c *Client) TransitionIssueByName(ctx context.Context, issueKey string, transitionName string, ...) error
- func (c *Client) UpdateComment(ctx context.Context, issueKey string, commentID string, body string, ...) (*Comment, error)
- func (c *Client) UpdateIssue(ctx context.Context, issueKey string, fields map[string]interface{}, ...) error
- func (c *Client) UpdateSprint(ctx context.Context, sprintID int, req *UpdateSprintRequest) (*Sprint, error)
- func (c *Client) UpdateVersion(ctx context.Context, versionID string, req *CreateVersionRequest) (*Version, error)
- func (c *Client) UpdateWorklog(ctx context.Context, issueKey string, worklogID string, ...) (*Worklog, error)
- func (c *Client) UploadAttachment(ctx context.Context, issueKey string, filename string, content io.Reader) (*Attachment, error)
- type Comment
- type Comments
- type Component
- type Config
- type CreateCommentRequest
- type CreateIssueLinkRequest
- type CreateIssueRequest
- type CreateSprintRequest
- type CreateVersionRequest
- type CreateWorklogRequest
- type DeploymentType
- type Description
- type ErrorResponse
- type Field
- type FieldMeta
- type FieldSchema
- type GetBoardsOptions
- type GetIssueOptions
- type GetProjectsOptions
- type Issue
- type IssueFields
- type IssueLink
- type IssueLinkType
- type IssueParent
- type IssueType
- type LinkApplication
- type LinkIcon
- type LinkIssueRef
- type LinkObject
- type LinkStatus
- type LinkedIssue
- type Location
- type Priority
- type Project
- type ProjectCategory
- type RemoteLink
- type Resolution
- type Schema
- type SearchOptions
- type SearchResult
- type Sprint
- type Status
- type StatusCategory
- type Transition
- type TransitionRequest
- type TransitionsResponse
- type UpdateIssueRequest
- type UpdateSprintRequest
- type User
- type Version
- type Visibility
- type Worklog
- type Worklogs
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtlassianTime ¶
AtlassianTime is a custom time type that handles multiple timestamp formats from Atlassian APIs
func (AtlassianTime) IsZero ¶
func (at AtlassianTime) IsZero() bool
IsZero returns true if the time is the zero value
func (AtlassianTime) MarshalJSON ¶
func (at AtlassianTime) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface
func (AtlassianTime) String ¶
func (at AtlassianTime) String() string
String returns the string representation of the time
func (*AtlassianTime) UnmarshalJSON ¶
func (at *AtlassianTime) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler interface
type Attachment ¶
type Attachment struct {
ID string `json:"id"`
Self string `json:"self,omitempty"`
Filename string `json:"filename"`
Author *User `json:"author,omitempty"`
Created AtlassianTime `json:"created,omitempty"`
Size int64 `json:"size,omitempty"`
MimeType string `json:"mimeType,omitempty"`
Content string `json:"content,omitempty"`
Thumbnail string `json:"thumbnail,omitempty"`
}
Attachment represents an issue attachment
type AvatarUrls ¶
type AvatarUrls struct {
Size48 string `json:"48x48,omitempty"`
Size24 string `json:"24x24,omitempty"`
Size16 string `json:"16x16,omitempty"`
Size32 string `json:"32x32,omitempty"`
}
AvatarUrls represents avatar URLs
type BatchCreateIssuesRequest ¶
type BatchCreateIssuesRequest struct {
IssueUpdates []CreateIssueRequest `json:"issueUpdates"`
}
BatchCreateIssuesRequest represents a batch create request
type BatchCreateIssuesResponse ¶
type BatchCreateIssuesResponse struct {
Issues []Issue `json:"issues,omitempty"`
Errors []BatchError `json:"errors,omitempty"`
}
BatchCreateIssuesResponse represents a batch create response
type BatchError ¶
type BatchError struct {
Status int `json:"status,omitempty"`
ElementErrors *ErrorResponse `json:"elementErrors,omitempty"`
FailedElement int `json:"failedElementNumber,omitempty"`
}
BatchError represents an error in a batch operation
type Board ¶
type Board struct {
ID int `json:"id"`
Self string `json:"self,omitempty"`
Name string `json:"name"`
Type string `json:"type"` // scrum, kanban, simple
Location *Location `json:"location,omitempty"`
}
Board represents an agile board
type Changelog ¶
type Changelog struct {
ID string `json:"id"`
Author *User `json:"author,omitempty"`
Created AtlassianTime `json:"created"`
Items []ChangelogItem `json:"items"`
}
Changelog represents issue changelog
type ChangelogItem ¶
type ChangelogItem struct {
Field string `json:"field"`
FieldType string `json:"fieldtype"`
From string `json:"from,omitempty"`
FromString string `json:"fromString,omitempty"`
To string `json:"to,omitempty"`
ToString string `json:"toString,omitempty"`
}
ChangelogItem represents a single changelog item
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Jira API client
func (*Client) AddAttachment ¶
func (c *Client) AddAttachment(ctx context.Context, issueKey string, filename string, content []byte) (*Attachment, error)
AddAttachment adds an attachment to an issue
func (*Client) AddComment ¶
func (c *Client) AddComment(ctx context.Context, issueKey string, body string, visibility *Visibility) (*Comment, error)
AddComment adds a comment to an issue
func (*Client) AddWorklog ¶
func (c *Client) AddWorklog(ctx context.Context, issueKey string, req *CreateWorklogRequest) (*Worklog, error)
AddWorklog adds a worklog entry to an issue
func (*Client) ArchiveVersion ¶
ArchiveVersion marks a version as archived
func (*Client) AssignIssue ¶
AssignIssue assigns an issue to a user
func (*Client) BatchCreateIssues ¶
func (c *Client) BatchCreateIssues(ctx context.Context, issuesFields []map[string]interface{}) (*BatchCreateIssuesResponse, error)
BatchCreateIssues creates multiple issues in a single request
func (*Client) BatchCreateVersions ¶
func (c *Client) BatchCreateVersions(ctx context.Context, versions []*CreateVersionRequest) ([]Version, error)
BatchCreateVersions creates multiple versions in a single request
func (*Client) BatchGetChangelogs ¶
func (c *Client) BatchGetChangelogs(ctx context.Context, issueKeys []string) (map[string][]Changelog, error)
BatchGetChangelogs retrieves changelogs for multiple issues (Cloud only)
func (*Client) CloseSprint ¶
CloseSprint closes a sprint
func (*Client) CreateIssue ¶
CreateIssue creates a new issue
func (*Client) CreateIssueLink ¶
func (c *Client) CreateIssueLink(ctx context.Context, linkType IssueLinkType, inwardIssue, outwardIssue string, comment *Comment) (*IssueLink, error)
CreateIssueLink creates a link between two issues
func (*Client) CreateIssueLinkByName ¶
func (c *Client) CreateIssueLinkByName(ctx context.Context, linkTypeName, inwardIssue, outwardIssue string, comment *Comment) (*IssueLink, error)
CreateIssueLinkByName creates a link using the link type name
func (*Client) CreateRemoteLink ¶
func (c *Client) CreateRemoteLink(ctx context.Context, issueKey string, link *RemoteLink) (*RemoteLink, error)
CreateRemoteLink creates a remote link to an issue
func (*Client) CreateSprint ¶
CreateSprint creates a new sprint
func (*Client) CreateVersion ¶
CreateVersion creates a new version
func (*Client) DeleteAttachment ¶
DeleteAttachment deletes an attachment
func (*Client) DeleteComment ¶
DeleteComment deletes a comment
func (*Client) DeleteIssue ¶
DeleteIssue deletes an issue
func (*Client) DeleteIssueLink ¶
DeleteIssueLink deletes an issue link
func (*Client) DeleteRemoteLink ¶
DeleteRemoteLink deletes a remote link
func (*Client) DeleteSprint ¶
DeleteSprint deletes a sprint
func (*Client) DeleteVersion ¶
func (c *Client) DeleteVersion(ctx context.Context, versionID string, moveFixIssuesTo, moveAffectedIssuesTo string) error
DeleteVersion deletes a version
func (*Client) DeleteWorklog ¶
DeleteWorklog deletes a worklog
func (*Client) DownloadAttachment ¶
DownloadAttachment downloads an attachment
func (*Client) DownloadAttachmentContent ¶
func (c *Client) DownloadAttachmentContent(ctx context.Context, attachment *Attachment) ([]byte, error)
DownloadAttachmentContent downloads the content of an attachment
func (*Client) FindAssignableUsers ¶
func (c *Client) FindAssignableUsers(ctx context.Context, project, issueKey, query string, maxResults int) ([]User, error)
FindAssignableUsers searches for users that can be assigned to issues
func (*Client) GetAllFields ¶
GetAllFields retrieves all fields (standard and custom)
func (*Client) GetAllProjects ¶
GetAllProjects retrieves all accessible projects
func (*Client) GetAttachment ¶
GetAttachment retrieves a specific attachment by ID
func (*Client) GetAttachmentMetadata ¶
func (c *Client) GetAttachmentMetadata(ctx context.Context, attachmentID string) (*Attachment, error)
GetAttachmentMetadata retrieves metadata for an attachment
func (*Client) GetAttachments ¶
GetAttachments retrieves all attachments for an issue
func (*Client) GetBacklogIssues ¶
func (c *Client) GetBacklogIssues(ctx context.Context, boardID int, opts *SearchOptions) (*SearchResult, error)
GetBacklogIssues retrieves backlog issues for a board
func (*Client) GetBoardIssues ¶
func (c *Client) GetBoardIssues(ctx context.Context, boardID int, opts *SearchOptions) (*SearchResult, error)
GetBoardIssues retrieves issues for a board
func (*Client) GetBoardSprints ¶
GetBoardSprints retrieves sprints for a board
func (*Client) GetChangelogs ¶
GetChangelogs retrieves the changelog for an issue
func (*Client) GetComment ¶
func (c *Client) GetComment(ctx context.Context, issueKey string, commentID string) (*Comment, error)
GetComment retrieves a specific comment by ID
func (*Client) GetComments ¶
GetComments retrieves all comments for an issue
func (*Client) GetCurrentUser ¶
GetCurrentUser retrieves the currently authenticated user
func (*Client) GetCustomFields ¶
GetCustomFields retrieves only custom fields
func (*Client) GetDeploymentType ¶
func (c *Client) GetDeploymentType() DeploymentType
GetDeploymentType returns the deployment type
func (*Client) GetEpicLinkField ¶
GetEpicLinkField attempts to find the Epic Link field
func (*Client) GetEssentialFields ¶
GetEssentialFields returns a list of essential field IDs
func (*Client) GetFieldByKey ¶
GetFieldByKey retrieves a field by its key or ID
func (*Client) GetFieldByName ¶
GetFieldByName retrieves a field by its exact name
func (*Client) GetIssue ¶
func (c *Client) GetIssue(ctx context.Context, issueKey string, opts *GetIssueOptions) (*Issue, error)
GetIssue retrieves an issue by key or ID
func (*Client) GetIssueLink ¶
GetIssueLink retrieves an issue link by ID
func (*Client) GetIssueLinkTypes ¶
func (c *Client) GetIssueLinkTypes(ctx context.Context) ([]IssueLinkType, error)
GetIssueLinkTypes retrieves all available issue link types
func (*Client) GetProject ¶
func (c *Client) GetProject(ctx context.Context, projectKey string, expand []string) (*Project, error)
GetProject retrieves a project by key or ID
func (*Client) GetProjectComponents ¶
GetProjectComponents retrieves all components for a project
func (*Client) GetProjectIssueTypes ¶
GetProjectIssueTypes retrieves all issue types for a project
func (*Client) GetProjectIssues ¶
func (c *Client) GetProjectIssues(ctx context.Context, projectKey string, opts *SearchOptions) (*SearchResult, error)
GetProjectIssues retrieves all issues for a project
func (*Client) GetProjectVersions ¶
GetProjectVersions retrieves all versions for a project
func (*Client) GetRemoteLinks ¶
GetRemoteLinks retrieves all remote links for an issue
func (*Client) GetSprintIssues ¶
func (c *Client) GetSprintIssues(ctx context.Context, sprintID int, opts *SearchOptions) (*SearchResult, error)
GetSprintIssues retrieves issues for a sprint
func (*Client) GetStoryPointsField ¶
GetStoryPointsField attempts to find the Story Points field
func (*Client) GetTransitionByName ¶
func (c *Client) GetTransitionByName(ctx context.Context, issueKey string, transitionName string) (*Transition, error)
GetTransitionByName retrieves a specific transition by name
func (*Client) GetTransitions ¶
GetTransitions retrieves available transitions for an issue
func (*Client) GetUserGroups ¶
GetUserGroups retrieves groups for a user
func (*Client) GetVersion ¶
GetVersion retrieves a version by ID
func (*Client) GetWorklog ¶
func (c *Client) GetWorklog(ctx context.Context, issueKey string, worklogID string) (*Worklog, error)
GetWorklog retrieves a specific worklog by ID
func (*Client) GetWorklogs ¶
GetWorklogs retrieves all worklogs for an issue
func (*Client) LinkToEpic ¶
LinkToEpic links an issue to an epic
func (*Client) MoveIssuesToSprint ¶
MoveIssuesToSprint moves issues to a sprint
func (*Client) ParseFieldList ¶
ParseFieldList parses a field list string and returns the appropriate fields "*all" returns all fields, otherwise returns the specified fields
func (*Client) ReleaseVersion ¶
func (c *Client) ReleaseVersion(ctx context.Context, versionID string, releaseDate string) (*Version, error)
ReleaseVersion marks a version as released
func (*Client) SearchFields ¶
SearchFields searches for fields by name or key (fuzzy search)
func (*Client) SearchIssues ¶
func (c *Client) SearchIssues(ctx context.Context, jql string, opts *SearchOptions) (*SearchResult, error)
SearchIssues searches for issues using JQL
func (*Client) SearchProjects ¶
func (c *Client) SearchProjects(ctx context.Context, query string, maxResults int) ([]Project, error)
SearchProjects searches for projects using a query string
func (*Client) SearchUsers ¶
SearchUsers searches for users
func (*Client) StartSprint ¶
StartSprint starts a sprint
func (*Client) TransitionIssue ¶
func (c *Client) TransitionIssue(ctx context.Context, issueKey string, transitionID string, fields map[string]interface{}) error
TransitionIssue transitions an issue to a new status
func (*Client) TransitionIssueByName ¶
func (c *Client) TransitionIssueByName(ctx context.Context, issueKey string, transitionName string, fields map[string]interface{}) error
TransitionIssueByName transitions an issue using the transition name instead of ID
func (*Client) UpdateComment ¶
func (c *Client) UpdateComment(ctx context.Context, issueKey string, commentID string, body string, visibility *Visibility) (*Comment, error)
UpdateComment updates an existing comment
func (*Client) UpdateIssue ¶
func (c *Client) UpdateIssue(ctx context.Context, issueKey string, fields map[string]interface{}, update map[string]interface{}) error
UpdateIssue updates an issue
func (*Client) UpdateSprint ¶
func (c *Client) UpdateSprint(ctx context.Context, sprintID int, req *UpdateSprintRequest) (*Sprint, error)
UpdateSprint updates an existing sprint
func (*Client) UpdateVersion ¶
func (c *Client) UpdateVersion(ctx context.Context, versionID string, req *CreateVersionRequest) (*Version, error)
UpdateVersion updates an existing version
func (*Client) UpdateWorklog ¶
func (c *Client) UpdateWorklog(ctx context.Context, issueKey string, worklogID string, req *CreateWorklogRequest) (*Worklog, error)
UpdateWorklog updates an existing worklog
type Comment ¶
type Comment struct {
ID string `json:"id"`
Self string `json:"self,omitempty"`
Author *User `json:"author,omitempty"`
Body *Description `json:"body"` // Can be plain text or ADF format
UpdateAuthor *User `json:"updateAuthor,omitempty"`
Created AtlassianTime `json:"created,omitempty"`
Updated AtlassianTime `json:"updated,omitempty"`
Visibility *Visibility `json:"visibility,omitempty"`
}
Comment represents an issue comment
type Comments ¶
type Comments struct {
StartAt int `json:"startAt"`
MaxResults int `json:"maxResults"`
Total int `json:"total"`
Comments []Comment `json:"comments"`
}
Comments represents a list of comments
type Component ¶
type Component struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Self string `json:"self,omitempty"`
Lead *User `json:"lead,omitempty"`
}
Component represents a project component
type Config ¶
type Config struct {
BaseURL string
Auth auth.Provider
CustomHeaders map[string]string
SSLVerify bool
HTTPProxy string
HTTPSProxy string
SOCKSProxy string
NoProxy string
}
Config holds the configuration for creating a Jira client
type CreateCommentRequest ¶
type CreateCommentRequest struct {
Body string `json:"body"`
Visibility *Visibility `json:"visibility,omitempty"`
}
CreateCommentRequest represents a request to add a comment
type CreateIssueLinkRequest ¶
type CreateIssueLinkRequest struct {
Type IssueLinkType `json:"type"`
InwardIssue LinkIssueRef `json:"inwardIssue"`
OutwardIssue LinkIssueRef `json:"outwardIssue"`
Comment *Comment `json:"comment,omitempty"`
}
CreateIssueLinkRequest represents a request to create an issue link
type CreateIssueRequest ¶
type CreateIssueRequest struct {
Fields map[string]interface{} `json:"fields"`
}
CreateIssueRequest represents a request to create an issue
type CreateSprintRequest ¶
type CreateSprintRequest struct {
Name string `json:"name"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
OriginBoardID int `json:"originBoardId"`
Goal string `json:"goal,omitempty"`
}
CreateSprintRequest represents a request to create a sprint
type CreateVersionRequest ¶
type CreateVersionRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
ProjectID int `json:"projectId,omitempty"`
Project string `json:"project,omitempty"`
ReleaseDate string `json:"releaseDate,omitempty"`
Released bool `json:"released,omitempty"`
Archived bool `json:"archived,omitempty"`
}
CreateVersionRequest represents a request to create a version
type CreateWorklogRequest ¶
type CreateWorklogRequest struct {
Comment string `json:"comment,omitempty"`
Started string `json:"started"`
TimeSpentSeconds int `json:"timeSpentSeconds"`
Visibility *Visibility `json:"visibility,omitempty"`
}
CreateWorklogRequest represents a request to add a worklog
type DeploymentType ¶
type DeploymentType string
DeploymentType represents the Jira deployment type
const ( DeploymentCloud DeploymentType = "cloud" DeploymentServer DeploymentType = "server" )
type Description ¶
type Description struct {
// contains filtered or unexported fields
}
Description represents a Jira description field that can be either plain text or ADF format.
Jira returns descriptions in different formats depending on the instance configuration:
- Plain text: Older instances or when text-only format is configured
- Atlassian Document Format (ADF): Modern Cloud instances and newer Server/DC versions
This type automatically detects the format during JSON unmarshaling and provides convenient methods to access the content:
- String() returns the plain text representation (extracted from ADF if needed)
- IsADF() returns true if the description is in ADF format
- Raw() returns the raw JSON for advanced use cases
Example usage:
issue, err := client.GetIssue(ctx, "PROJ-123", nil)
if err != nil {
return err
}
if issue.Fields.Description != nil {
fmt.Println("Description:", issue.Fields.Description.String())
if issue.Fields.Description.IsADF() {
fmt.Println("(ADF format)")
}
}
When creating or updating issues, pass description as a plain string in the fields map:
fields := map[string]interface{}{
"description": "This is a plain text description",
// ... other fields
}
Example (AdfFormat) ¶
Example showing how to use the Description type with ADF format
jsonData := `{
"summary": "Feature request",
"description": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Add support for "
},
{
"type": "text",
"text": "OAuth 2.0",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This will improve security."
}
]
}
]
}
}`
var fields IssueFields
err := json.Unmarshal([]byte(jsonData), &fields)
if err != nil {
panic(err)
}
fmt.Println("Summary:", fields.Summary)
if fields.Description != nil {
fmt.Println("Description:", fields.Description.String())
fmt.Println("Is ADF:", fields.Description.IsADF())
}
Output: Summary: Feature request Description: Add support for OAuth 2.0 This will improve security. Is ADF: true
Example (PlainText) ¶
Example showing how to use the Description type with plain text
jsonData := `{
"summary": "Bug in authentication",
"description": "User cannot login after password reset"
}`
var fields IssueFields
err := json.Unmarshal([]byte(jsonData), &fields)
if err != nil {
panic(err)
}
fmt.Println("Summary:", fields.Summary)
if fields.Description != nil {
fmt.Println("Description:", fields.Description.String())
fmt.Println("Is ADF:", fields.Description.IsADF())
}
Output: Summary: Bug in authentication Description: User cannot login after password reset Is ADF: false
func NewDescription ¶ added in v0.1.2
func NewDescription(text string) *Description
NewDescription creates a new Description from a plain text string
func (*Description) IsADF ¶
func (d *Description) IsADF() bool
IsADF returns true if the description is in ADF format
func (Description) MarshalJSON ¶
func (d Description) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface
func (*Description) Raw ¶
func (d *Description) Raw() json.RawMessage
Raw returns the raw JSON representation
func (*Description) String ¶
func (d *Description) String() string
String returns the plain text representation of the description
func (*Description) UnmarshalJSON ¶
func (d *Description) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler interface to handle both plain text and ADF format
type ErrorResponse ¶
type ErrorResponse struct {
ErrorMessages []string `json:"errorMessages,omitempty"`
Errors map[string]string `json:"errors,omitempty"`
}
ErrorResponse represents a Jira error response
type Field ¶
type Field struct {
ID string `json:"id"`
Key string `json:"key,omitempty"`
Name string `json:"name"`
Custom bool `json:"custom"`
Orderable bool `json:"orderable,omitempty"`
Searchable bool `json:"searchable,omitempty"`
ClauseNames []string `json:"clauseNames,omitempty"`
Schema *FieldSchema `json:"schema,omitempty"`
}
Field represents a Jira field (standard or custom)
type FieldMeta ¶
type FieldMeta struct {
Required bool `json:"required"`
Schema Schema `json:"schema,omitempty"`
Name string `json:"name,omitempty"`
}
FieldMeta represents metadata about a field in a transition
type FieldSchema ¶
type FieldSchema struct {
Type string `json:"type"`
Items string `json:"items,omitempty"`
System string `json:"system,omitempty"`
Custom string `json:"custom,omitempty"`
CustomID int `json:"customId,omitempty"`
}
FieldSchema represents the schema of a field
type GetBoardsOptions ¶
type GetBoardsOptions struct {
ProjectKeyOrID string
BoardType string // scrum, kanban, simple
Name string
StartAt int
MaxResults int
}
GetBoardsOptions contains options for getting boards
type GetIssueOptions ¶
type GetIssueOptions struct {
Fields []string // Specific fields to retrieve, or "*all" for all fields
Expand []string // Resources to expand (e.g., "changelog", "renderedFields")
Properties []string // Properties to retrieve
}
GetIssueOptions contains options for getting an issue
type GetProjectsOptions ¶
type GetProjectsOptions struct {
Expand []string // Resources to expand (e.g., "description", "lead", "issueTypes")
Recent int // Number of recent projects to return
Properties []string // Project properties to return
}
GetProjectsOptions contains options for listing projects
type Issue ¶
type Issue struct {
ID string `json:"id"`
Key string `json:"key"`
Self string `json:"self"`
Fields IssueFields `json:"fields"`
Expand string `json:"expand,omitempty"`
}
Issue represents a Jira issue
type IssueFields ¶
type IssueFields struct {
Summary string `json:"summary,omitempty"`
Description *Description `json:"description,omitempty"`
IssueType *IssueType `json:"issuetype,omitempty"`
Project *Project `json:"project,omitempty"`
Reporter *User `json:"reporter,omitempty"`
Assignee *User `json:"assignee,omitempty"`
Priority *Priority `json:"priority,omitempty"`
Status *Status `json:"status,omitempty"`
Resolution *Resolution `json:"resolution,omitempty"`
Labels []string `json:"labels,omitempty"`
Components []Component `json:"components,omitempty"`
FixVersions []Version `json:"fixVersions,omitempty"`
Versions []Version `json:"versions,omitempty"`
Created AtlassianTime `json:"created,omitempty"`
Updated AtlassianTime `json:"updated,omitempty"`
DueDate *string `json:"duedate,omitempty"`
Parent *IssueParent `json:"parent,omitempty"`
Subtasks []Issue `json:"subtasks,omitempty"`
IssueLinks []IssueLink `json:"issuelinks,omitempty"`
Attachment []Attachment `json:"attachment,omitempty"`
Comment *Comments `json:"comment,omitempty"`
Worklog *Worklogs `json:"worklog,omitempty"`
// Custom fields stored as raw JSON
Unknowns map[string]interface{} `json:"-"`
}
IssueFields represents all possible fields in a Jira issue
type IssueLink ¶
type IssueLink struct {
ID string `json:"id"`
Type IssueLinkType `json:"type"`
InwardIssue *LinkedIssue `json:"inwardIssue,omitempty"`
OutwardIssue *LinkedIssue `json:"outwardIssue,omitempty"`
Self string `json:"self,omitempty"`
}
IssueLink represents a link between issues
type IssueLinkType ¶
type IssueLinkType struct {
ID string `json:"id"`
Name string `json:"name"`
Inward string `json:"inward"`
Outward string `json:"outward"`
Self string `json:"self,omitempty"`
}
IssueLinkType represents the type of link between issues
type IssueParent ¶
type IssueParent struct {
ID string `json:"id"`
Key string `json:"key"`
Self string `json:"self,omitempty"`
Fields IssueFields `json:"fields,omitempty"`
}
IssueParent represents the parent of a subtask
type IssueType ¶
type IssueType struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Self string `json:"self,omitempty"`
IconURL string `json:"iconUrl,omitempty"`
Subtask bool `json:"subtask,omitempty"`
}
IssueType represents a Jira issue type
type LinkApplication ¶
LinkApplication represents the application in a remote link
type LinkIcon ¶
type LinkIcon struct {
URL16x16 string `json:"url16x16,omitempty"`
Title string `json:"title,omitempty"`
}
LinkIcon represents an icon in a remote link
type LinkIssueRef ¶
LinkIssueRef represents an issue reference in a link request
type LinkObject ¶
type LinkObject struct {
URL string `json:"url"`
Title string `json:"title"`
Summary string `json:"summary,omitempty"`
Icon *LinkIcon `json:"icon,omitempty"`
Status *LinkStatus `json:"status,omitempty"`
}
LinkObject represents the object in a remote link
type LinkStatus ¶
type LinkStatus struct {
Resolved bool `json:"resolved,omitempty"`
Icon *LinkIcon `json:"icon,omitempty"`
}
LinkStatus represents status in a remote link
type LinkedIssue ¶
type LinkedIssue struct {
ID string `json:"id"`
Key string `json:"key"`
Self string `json:"self,omitempty"`
Fields IssueFields `json:"fields,omitempty"`
}
LinkedIssue represents a linked issue
type Location ¶
type Location struct {
ProjectID int `json:"projectId,omitempty"`
DisplayName string `json:"displayName,omitempty"`
ProjectName string `json:"projectName,omitempty"`
ProjectKey string `json:"projectKey,omitempty"`
ProjectType string `json:"projectTypeKey,omitempty"`
AvatarURI string `json:"avatarURI,omitempty"`
Name string `json:"name,omitempty"`
}
Location represents a board location
type Priority ¶
type Priority struct {
ID string `json:"id"`
Name string `json:"name"`
Self string `json:"self,omitempty"`
IconURL string `json:"iconUrl,omitempty"`
}
Priority represents issue priority
type Project ¶
type Project struct {
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Self string `json:"self,omitempty"`
ProjectTypeKey string `json:"projectTypeKey,omitempty"`
AvatarUrls *AvatarUrls `json:"avatarUrls,omitempty"`
Lead *User `json:"lead,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
IssueTypes []IssueType `json:"issueTypes,omitempty"`
ProjectCategory *ProjectCategory `json:"projectCategory,omitempty"`
Versions []Version `json:"versions,omitempty"`
Components []Component `json:"components,omitempty"`
}
Project represents a Jira project
type ProjectCategory ¶
type ProjectCategory struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Self string `json:"self,omitempty"`
}
ProjectCategory represents a project category
type RemoteLink ¶
type RemoteLink struct {
ID string `json:"id,omitempty"`
Self string `json:"self,omitempty"`
GlobalID string `json:"globalId,omitempty"`
Application *LinkApplication `json:"application,omitempty"`
Relationship string `json:"relationship,omitempty"`
Object *LinkObject `json:"object,omitempty"`
}
RemoteLink represents a remote issue link
type Resolution ¶
type Resolution struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Self string `json:"self,omitempty"`
}
Resolution represents issue resolution
type SearchOptions ¶
type SearchOptions struct {
Fields []string // Specific fields to retrieve
Expand []string // Resources to expand
StartAt int // Index of the first issue to return (0-based)
MaxResults int // Maximum number of issues to return (default 50, max 100 for Cloud, 1000 for Server)
ValidateQuery bool // Whether to validate the JQL query
}
SearchOptions contains options for searching issues
type SearchResult ¶
type SearchResult struct {
Expand string `json:"expand,omitempty"`
StartAt int `json:"startAt"`
MaxResults int `json:"maxResults"`
Total int `json:"total"`
Issues []Issue `json:"issues"`
}
SearchResult represents the result of a JQL search
type Sprint ¶
type Sprint struct {
ID int `json:"id"`
Self string `json:"self,omitempty"`
State string `json:"state"` // future, active, closed
Name string `json:"name"`
StartDate *AtlassianTime `json:"startDate,omitempty"`
EndDate *AtlassianTime `json:"endDate,omitempty"`
CompleteDate *AtlassianTime `json:"completeDate,omitempty"`
OriginBoardID int `json:"originBoardId,omitempty"`
Goal string `json:"goal,omitempty"`
}
Sprint represents a sprint
type Status ¶
type Status struct {
ID string `json:"id"`
Name string `json:"name"`
Self string `json:"self,omitempty"`
Description string `json:"description,omitempty"`
IconURL string `json:"iconUrl,omitempty"`
StatusCategory *StatusCategory `json:"statusCategory,omitempty"`
}
Status represents issue status
type StatusCategory ¶
type StatusCategory struct {
ID int `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Self string `json:"self,omitempty"`
ColorName string `json:"colorName,omitempty"`
}
StatusCategory represents a status category
type Transition ¶
type Transition struct {
ID string `json:"id"`
Name string `json:"name"`
To Status `json:"to"`
Fields map[string]FieldMeta `json:"fields,omitempty"`
}
Transition represents a status transition
type TransitionRequest ¶
type TransitionRequest struct {
Transition Transition `json:"transition"`
Fields map[string]interface{} `json:"fields,omitempty"`
}
TransitionRequest represents a request to transition an issue
type TransitionsResponse ¶
type TransitionsResponse struct {
Expand string `json:"expand,omitempty"`
Transitions []Transition `json:"transitions"`
}
TransitionsResponse represents the response from getting transitions
type UpdateIssueRequest ¶
type UpdateIssueRequest struct {
Fields map[string]interface{} `json:"fields,omitempty"`
Update map[string]interface{} `json:"update,omitempty"`
}
UpdateIssueRequest represents a request to update an issue
type UpdateSprintRequest ¶
type UpdateSprintRequest struct {
Name string `json:"name,omitempty"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
State string `json:"state,omitempty"`
Goal string `json:"goal,omitempty"`
CompleteDate string `json:"completeDate,omitempty"`
}
UpdateSprintRequest represents a request to update a sprint
type User ¶
type User struct {
Self string `json:"self,omitempty"`
AccountID string `json:"accountId,omitempty"` // Cloud
Name string `json:"name,omitempty"` // Server/DC
Key string `json:"key,omitempty"` // Server/DC
EmailAddress string `json:"emailAddress,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Active bool `json:"active,omitempty"`
TimeZone string `json:"timeZone,omitempty"`
AvatarUrls *AvatarUrls `json:"avatarUrls,omitempty"`
}
User represents a Jira user
type Version ¶
type Version struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Self string `json:"self,omitempty"`
Archived bool `json:"archived,omitempty"`
Released bool `json:"released,omitempty"`
ReleaseDate *AtlassianTime `json:"releaseDate,omitempty"`
ProjectID int `json:"projectId,omitempty"`
}
Version represents a project version
type Visibility ¶
type Visibility struct {
Type string `json:"type"` // "group" or "role"
Value string `json:"value"` // group name or role name
}
Visibility represents comment/worklog visibility
type Worklog ¶
type Worklog struct {
ID string `json:"id"`
Self string `json:"self,omitempty"`
Author *User `json:"author,omitempty"`
UpdateAuthor *User `json:"updateAuthor,omitempty"`
Comment string `json:"comment,omitempty"`
Created AtlassianTime `json:"created,omitempty"`
Updated AtlassianTime `json:"updated,omitempty"`
Started AtlassianTime `json:"started"`
TimeSpent string `json:"timeSpent"`
TimeSpentSeconds int `json:"timeSpentSeconds"`
Visibility *Visibility `json:"visibility,omitempty"`
}
Worklog represents a worklog entry