Documentation ¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func NewJiraError(resp *Response, httpError error) error
- func WithAccountId(accountId string) userSearchF
- func WithActive(active bool) userSearchF
- func WithInactive(inactive bool) userSearchF
- func WithMaxResults(maxResults int) userSearchF
- func WithProperty(property string) userSearchF
- func WithQueryOptions(options interface{}) func(*http.Request) error
- func WithStartAt(startAt int) userSearchF
- func WithUsername(username string) userSearchF
- type Actor
- type ActorUser
- type AddWorklogQueryOptions
- type AffectsVersion
- type AllowedValue
- type Attachment
- type AuthenticationService
- func (s *AuthenticationService) AcquireSessionCookie(ctx context.Context, username, password string) (bool, error)deprecated
- func (s *AuthenticationService) Authenticated() bool
- func (s *AuthenticationService) GetCurrentUser(ctx context.Context) (*Session, error)
- func (s *AuthenticationService) Logout(ctx context.Context) errordeprecated
- func (s *AuthenticationService) SetBasicAuth(username, password string)deprecated
- type AvatarUrls
- type BasicAuthTransport
- type BearerAuthTransport
- type Board
- type BoardConfiguration
- type BoardConfigurationColumn
- type BoardConfigurationColumnConfig
- type BoardConfigurationColumnStatus
- type BoardConfigurationFilter
- type BoardConfigurationLocation
- type BoardConfigurationSubQuery
- type BoardListOptions
- type BoardService
- func (s *BoardService) CreateBoard(ctx context.Context, board *Board) (*Board, *Response, error)
- func (s *BoardService) DeleteBoard(ctx context.Context, boardID int) (*Board, *Response, error)
- func (s *BoardService) GetAllBoards(ctx context.Context, opt *BoardListOptions) (*BoardsList, *Response, error)
- func (s *BoardService) GetAllSprints(ctx context.Context, boardID int, options *GetAllSprintsOptions) (*SprintsList, *Response, error)
- func (s *BoardService) GetBoard(ctx context.Context, boardID int) (*Board, *Response, error)
- func (s *BoardService) GetBoardConfiguration(ctx context.Context, boardID int) (*BoardConfiguration, *Response, error)
- type BoardsList
- type Changelog
- type ChangelogHistory
- type ChangelogItems
- type Client
- func (c *Client) Client() *http.Client
- func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)
- func (c *Client) NewMultiPartRequest(ctx context.Context, method, urlStr string, buf *bytes.Buffer) (*http.Request, error)
- func (c *Client) NewRawRequest(ctx context.Context, method, urlStr string, body io.Reader) (*http.Request, error)
- func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)
- type Comment
- type CommentVisibility
- type Comments
- type Component
- type ComponentService
- type CookieAuthTransport
- type CreateComponentOptions
- type CreateMetaInfo
- type CreateTransitionPayload
- type CustomFields
- type Customer
- type CustomerList
- type CustomerListOptions
- type CustomerService
- type Date
- type EditMetaInfo
- type EntityProperty
- type Epic
- type Error
- type Field
- type FieldSchema
- type FieldService
- type Filter
- type FilterSearchOptions
- type FilterService
- func (fs *FilterService) Get(ctx context.Context, filterID int) (*Filter, *Response, error)
- func (fs *FilterService) GetFavouriteList(ctx context.Context) ([]*Filter, *Response, error)
- func (fs *FilterService) GetList(ctx context.Context) ([]*Filter, *Response, error)
- func (fs *FilterService) GetMyFilters(ctx context.Context, opts *GetMyFiltersQueryOptions) ([]*Filter, *Response, error)
- func (fs *FilterService) Search(ctx context.Context, opt *FilterSearchOptions) (*FiltersList, *Response, error)
- type FiltersList
- type FiltersListItem
- type FixVersion
- type GetAllSprintsOptions
- type GetGroupMembersResult
- type GetMyFiltersQueryOptions
- type GetQueryOptions
- type GetWorklogsQueryOptions
- type Group
- type GroupMember
- type GroupMembersUsers
- type GroupMeta
- type GroupSearchOptions
- type GroupService
- func (s *GroupService) Add(ctx context.Context, groupname string, username string) (*Group, *Response, error)
- func (s *GroupService) Get(ctx context.Context, name string, options *GroupSearchOptions) ([]GroupMember, *Response, error)
- func (s *GroupService) GetAll(ctx context.Context) ([]GroupMeta, *Response, error)
- func (s *GroupService) GetGroupMembers(ctx context.Context, name string) ([]GroupMember, *Response, error)
- func (s *GroupService) Remove(ctx context.Context, groupname string, username string) (*Response, error)
- type GroupsResult
- type Holder
- type Issue
- type IssueFields
- type IssueLink
- type IssueLinkType
- type IssueLinkTypeService
- func (s *IssueLinkTypeService) Create(ctx context.Context, linkType *IssueLinkType) (*IssueLinkType, *Response, error)
- func (s *IssueLinkTypeService) Delete(ctx context.Context, ID string) (*Response, error)
- func (s *IssueLinkTypeService) Get(ctx context.Context, ID string) (*IssueLinkType, *Response, error)
- func (s *IssueLinkTypeService) GetList(ctx context.Context) ([]IssueLinkType, *Response, error)
- func (s *IssueLinkTypeService) Update(ctx context.Context, linkType *IssueLinkType) (*IssueLinkType, *Response, error)
- type IssueRenderedFields
- type IssueService
- func (s *IssueService) AddComment(ctx context.Context, issueID string, comment *Comment) (*Comment, *Response, error)
- func (s *IssueService) AddLink(ctx context.Context, issueLink *IssueLink) (*Response, error)
- func (s *IssueService) AddRemoteLink(ctx context.Context, issueID string, remotelink *RemoteLink) (*RemoteLink, *Response, error)
- func (s *IssueService) AddWatcher(ctx context.Context, issueID string, userName string) (*Response, error)
- func (s *IssueService) AddWorklogRecord(ctx context.Context, issueID string, record *WorklogRecord, ...) (*WorklogRecord, *Response, error)
- func (s *IssueService) Create(ctx context.Context, issue *Issue) (*Issue, *Response, error)
- func (s *IssueService) Delete(ctx context.Context, issueID string) (*Response, error)
- func (s *IssueService) DeleteAttachment(ctx context.Context, attachmentID string) (*Response, error)
- func (s *IssueService) DeleteComment(ctx context.Context, issueID, commentID string) error
- func (s *IssueService) DeleteLink(ctx context.Context, linkID string) (*Response, error)
- func (s *IssueService) DoTransition(ctx context.Context, ticketID, transitionID string) (*Response, error)
- func (s *IssueService) DoTransitionWithPayload(ctx context.Context, ticketID, payload interface{}) (*Response, error)
- func (s *IssueService) DownloadAttachment(ctx context.Context, attachmentID string) (*Response, error)
- func (s *IssueService) Get(ctx context.Context, issueID string, options *GetQueryOptions) (*Issue, *Response, error)
- func (s *IssueService) GetCreateMeta(ctx context.Context, options *GetQueryOptions) (*CreateMetaInfo, *Response, error)
- func (s *IssueService) GetCustomFields(ctx context.Context, issueID string) (CustomFields, *Response, error)
- func (s *IssueService) GetEditMeta(ctx context.Context, issue *Issue) (*EditMetaInfo, *Response, error)
- func (s *IssueService) GetProjectIssueFields(ctx context.Context, projectIdOrKey string, issueTypeID string) ([]ProjectIssueField, *Response, error)
- func (s *IssueService) GetProjectIssueTypes(ctx context.Context, projectIdOrKey string) ([]MetaIssueType, *Response, error)
- func (s *IssueService) GetRemoteLinks(ctx context.Context, id string) (*[]RemoteLink, *Response, error)
- func (s *IssueService) GetTransitions(ctx context.Context, id string) ([]Transition, *Response, error)
- func (s *IssueService) GetWatchers(ctx context.Context, issueID string) (*[]User, *Response, error)
- func (s *IssueService) GetWorklogs(ctx context.Context, issueID string, options ...func(*http.Request) error) (*Worklog, *Response, error)
- func (s *IssueService) PostAttachment(ctx context.Context, issueID string, r io.Reader, attachmentName string) (*[]Attachment, *Response, error)
- func (s *IssueService) RemoveWatcher(ctx context.Context, issueID string, userName string) (*Response, error)
- func (s *IssueService) Search(ctx context.Context, jql string, options *SearchOptions) ([]Issue, *Response, error)
- func (s *IssueService) SearchPages(ctx context.Context, jql string, options *SearchOptions, f func(Issue) error) error
- func (s *IssueService) Update(ctx context.Context, issue *Issue, opts *UpdateQueryOptions) (*Issue, *Response, error)
- func (s *IssueService) UpdateAssignee(ctx context.Context, issueID string, assignee *User) (*Response, error)
- func (s *IssueService) UpdateComment(ctx context.Context, issueID string, comment *Comment) (*Comment, *Response, error)
- func (s *IssueService) UpdateIssue(ctx context.Context, jiraID string, data map[string]interface{}) (*Response, error)
- func (s *IssueService) UpdateRemoteLink(ctx context.Context, issueID string, linkID int, remotelink *RemoteLink) (*Response, error)
- func (s *IssueService) UpdateWorklogRecord(ctx context.Context, issueID, worklogID string, record *WorklogRecord, ...) (*WorklogRecord, *Response, error)
- type IssueType
- type IssuesInSprintResult
- type IssuesWrapper
- type JWTAuthTransport
- type MetaIssueType
- type MetaProject
- type Option
- type Organization
- type OrganizationCreationDTO
- type OrganizationService
- func (s *OrganizationService) AddUsers(ctx context.Context, organizationID int, users OrganizationUsersDTO) (*Response, error)
- func (s *OrganizationService) CreateOrganization(ctx context.Context, name string) (*Organization, *Response, error)
- func (s *OrganizationService) DeleteOrganization(ctx context.Context, organizationID int) (*Response, error)
- func (s *OrganizationService) DeleteProperty(ctx context.Context, organizationID int, propertyKey string) (*Response, error)
- func (s *OrganizationService) GetAllOrganizations(ctx context.Context, start int, limit int, accountID string) (*PagedDTO, *Response, error)
- func (s *OrganizationService) GetOrganization(ctx context.Context, organizationID int) (*Organization, *Response, error)
- func (s *OrganizationService) GetPropertiesKeys(ctx context.Context, organizationID int) (*PropertyKeys, *Response, error)
- func (s *OrganizationService) GetProperty(ctx context.Context, organizationID int, propertyKey string) (*EntityProperty, *Response, error)
- func (s *OrganizationService) GetUsers(ctx context.Context, organizationID int, start int, limit int) (*PagedDTO, *Response, error)
- func (s *OrganizationService) RemoveUsers(ctx context.Context, organizationID int, users OrganizationUsersDTO) (*Response, error)
- func (s *OrganizationService) SetProperty(ctx context.Context, organizationID int, propertyKey string) (*Response, error)
- type OrganizationUsersDTO
- type PATAuthTransport
- type PagedDTO
- type Parent
- type Permission
- type PermissionScheme
- type PermissionSchemeService
- type PermissionSchemes
- type Priority
- type PriorityService
- type Progress
- type Project
- type ProjectCategory
- type ProjectComponent
- type ProjectIssueField
- type ProjectIssueFieldsResult
- type ProjectIssueTypesResult
- type ProjectList
- type ProjectService
- func (s *ProjectService) Get(ctx context.Context, projectID string) (*Project, *Response, error)
- func (s *ProjectService) GetAll(ctx context.Context, options *GetQueryOptions) (*ProjectList, *Response, error)
- func (s *ProjectService) GetPermissionScheme(ctx context.Context, projectID string) (*PermissionScheme, *Response, error)
- type PropertyKey
- type PropertyKeys
- type RemoteLink
- type RemoteLinkApplication
- type RemoteLinkIcon
- type RemoteLinkObject
- type RemoteLinkStatus
- type Request
- type RequestComment
- type RequestDate
- type RequestFieldValue
- type RequestService
- type RequestStatus
- type Resolution
- type ResolutionService
- type Response
- type Role
- type RoleService
- type SearchOptions
- type SelfLink
- type ServiceDeskOrganizationDTO
- type ServiceDeskService
- func (s *ServiceDeskService) AddCustomers(ctx context.Context, serviceDeskID interface{}, acountIDs ...string) (*Response, error)
- func (s *ServiceDeskService) AddOrganization(ctx context.Context, serviceDeskID interface{}, organizationID int) (*Response, error)
- func (s *ServiceDeskService) GetOrganizations(ctx context.Context, serviceDeskID interface{}, start int, limit int, ...) (*PagedDTO, *Response, error)
- func (s *ServiceDeskService) ListCustomers(ctx context.Context, serviceDeskID interface{}, options *CustomerListOptions) (*CustomerList, *Response, error)
- func (s *ServiceDeskService) RemoveCustomers(ctx context.Context, serviceDeskID interface{}, acountIDs ...string) (*Response, error)
- func (s *ServiceDeskService) RemoveOrganization(ctx context.Context, serviceDeskID interface{}, organizationID int) (*Response, error)
- type Session
- type Sprint
- type SprintService
- func (s *SprintService) GetIssue(ctx context.Context, issueID string, options *GetQueryOptions) (*Issue, *Response, error)
- func (s *SprintService) GetIssuesForSprint(ctx context.Context, sprintID int) ([]Issue, *Response, error)
- func (s *SprintService) MoveIssuesToSprint(ctx context.Context, sprintID int, issueIDs []string) (*Response, error)
- type SprintsList
- type Status
- type StatusCategory
- type StatusCategoryService
- type StatusService
- type Subtasks
- type Time
- type TimeTracking
- type Transition
- type TransitionField
- type TransitionPayload
- type TransitionPayloadComment
- type TransitionPayloadCommentBody
- type TransitionPayloadFields
- type TransitionPayloadUpdate
- type UpdateQueryOptions
- type User
- type UserGroup
- type UserService
- func (s *UserService) Create(ctx context.Context, user *User) (*User, *Response, error)
- func (s *UserService) Delete(ctx context.Context, accountId string) (*Response, error)
- func (s *UserService) Find(ctx context.Context, property string, tweaks ...userSearchF) ([]User, *Response, error)
- func (s *UserService) Get(ctx context.Context, accountId string) (*User, *Response, error)
- func (s *UserService) GetByAccountID(ctx context.Context, accountID string) (*User, *Response, error)
- func (s *UserService) GetGroups(ctx context.Context, accountId string) (*[]UserGroup, *Response, error)
- func (s *UserService) GetSelf(ctx context.Context) (*User, *Response, error)
- type Version
- type VersionService
- type Watcher
- type Watches
- type Worklog
- type WorklogRecord
Constants ¶
const ( StatusCategoryComplete = "done" StatusCategoryInProgress = "indeterminate" StatusCategoryToDo = "new" StatusCategoryUndefined = "undefined" )
These constants are the keys of the default Jira status categories
const (
// AssigneeAutomatic represents the value of the "Assignee: Automatic" of Jira
AssigneeAutomatic = "-1"
)
const (
ClientVersion = "2.0.0"
)
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. The caller is responsible to analyze the response body. The body can contain JSON (if the error is intended) or xml (sometimes Jira just failes).
func NewJiraError ¶
NewJiraError creates a new jira Error
func WithAccountId ¶
func WithAccountId(accountId string) userSearchF
WithAccountId sets the account id to search
func WithInactive ¶
func WithInactive(inactive bool) userSearchF
WithInactive sets the inactive users lookup
func WithMaxResults ¶
func WithMaxResults(maxResults int) userSearchF
WithMaxResults sets the max results to return
func WithProperty ¶
func WithProperty(property string) userSearchF
WithProperty sets the property (Property keys are specified by path) to search
func WithQueryOptions ¶
Applies query options to http request. This helper is meant to be used with all "QueryOptions" structs.
func WithUsername ¶
func WithUsername(username string) userSearchF
WithUsername sets the username to search
Types ¶
type Actor ¶
type Actor struct { ID int `json:"id" structs:"id"` DisplayName string `json:"displayName" structs:"displayName"` Type string `json:"type" structs:"type"` Name string `json:"name" structs:"name"` AvatarURL string `json:"avatarUrl" structs:"avatarUrl"` ActorUser *ActorUser `json:"actorUser" structs:"actoruser"` }
Actor represents a Jira actor
type ActorUser ¶
type ActorUser struct {
AccountID string `json:"accountId" structs:"accountId"`
}
ActorUser contains the account id of the actor/user
type AddWorklogQueryOptions ¶
type AddWorklogQueryOptions struct { NotifyUsers bool `url:"notifyUsers,omitempty"` AdjustEstimate string `url:"adjustEstimate,omitempty"` NewEstimate string `url:"newEstimate,omitempty"` ReduceBy string `url:"reduceBy,omitempty"` Expand string `url:"expand,omitempty"` OverrideEditableFlag bool `url:"overrideEditableFlag,omitempty"` }
type AffectsVersion ¶
type AffectsVersion Version
AffectsVersion represents a software release which is affected by an issue.
type AllowedValue ¶ added in v1.0.4
type AllowedValue struct { Self string `json:"self,omitempty"` ID string `json:"id,omitempty"` Key string `json:"key,omitempty"` ProjectTypeKey string `json:"projectTypeKey,omitempty"` Description string `json:"description,omitempty"` IconURL string `json:"iconUrl,omitempty"` Name string `json:"name,omitempty"` Subtask bool `json:"subtask,omitempty"` AvatarID int `json:"avatarId,omitempty"` }
type Attachment ¶
type Attachment struct { Self string `json:"self,omitempty" structs:"self,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` Filename string `json:"filename,omitempty" structs:"filename,omitempty"` Author *User `json:"author,omitempty" structs:"author,omitempty"` Created string `json:"created,omitempty" structs:"created,omitempty"` Size int `json:"size,omitempty" structs:"size,omitempty"` MimeType string `json:"mimeType,omitempty" structs:"mimeType,omitempty"` Content string `json:"content,omitempty" structs:"content,omitempty"` Thumbnail string `json:"thumbnail,omitempty" structs:"thumbnail,omitempty"` }
Attachment represents a Jira attachment
type AuthenticationService ¶
type AuthenticationService struct {
// contains filtered or unexported fields
}
AuthenticationService handles authentication for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#authentication
func (*AuthenticationService) AcquireSessionCookie
deprecated
func (s *AuthenticationService) AcquireSessionCookie(ctx context.Context, username, password string) (bool, error)
AcquireSessionCookie creates a new session for a user in Jira. Once a session has been successfully created it can be used to access any of Jira's remote APIs and also the web UI by passing the appropriate HTTP Cookie header. The header will by automatically applied to every API request. Note that it is generally preferrable to use HTTP BASIC authentication with the REST API. However, this resource may be used to mimic the behaviour of Jira's log-in page (e.g. to display log-in errors to a user).
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
Deprecated: Use CookieAuthTransport instead
func (*AuthenticationService) Authenticated ¶
func (s *AuthenticationService) Authenticated() bool
Authenticated reports if the current Client has authentication details for Jira
func (*AuthenticationService) GetCurrentUser ¶
func (s *AuthenticationService) GetCurrentUser(ctx context.Context) (*Session, error)
GetCurrentUser gets the details of the current user.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
func (*AuthenticationService) Logout
deprecated
func (s *AuthenticationService) Logout(ctx context.Context) error
Logout logs out the current user that has been authenticated and the session in the client is destroyed.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
Deprecated: Use CookieAuthTransport to create base client. Logging out is as simple as not using the client anymore
func (*AuthenticationService) SetBasicAuth
deprecated
func (s *AuthenticationService) SetBasicAuth(username, password string)
SetBasicAuth sets username and password for the basic auth against the Jira instance.
Deprecated: Use BasicAuthTransport instead
type AvatarUrls ¶
type AvatarUrls struct { Four8X48 string `json:"48x48,omitempty" structs:"48x48,omitempty"` Two4X24 string `json:"24x24,omitempty" structs:"24x24,omitempty"` One6X16 string `json:"16x16,omitempty" structs:"16x16,omitempty"` Three2X32 string `json:"32x32,omitempty" structs:"32x32,omitempty"` }
AvatarUrls represents different dimensions of avatars / images
type BasicAuthTransport ¶
type BasicAuthTransport struct { Username string Password string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
BasicAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Basic Authentication with the provided username and password.
func (*BasicAuthTransport) Client ¶
func (t *BasicAuthTransport) Client() *http.Client
Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication. This is a nice little bit of sugar so we can just get the client instead of creating the client in the calling code. If it's necessary to send more information on client init, the calling code can always skip this and set the transport itself.
type BearerAuthTransport ¶
type BearerAuthTransport struct { Token string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
BearerAuthTransport is a http.RoundTripper that authenticates all requests using Jira's bearer (oauth 2.0 (3lo)) based authentication.
func (*BearerAuthTransport) Client ¶
func (t *BearerAuthTransport) Client() *http.Client
Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication. This is a nice little bit of sugar so we can just get the client instead of creating the client in the calling code. If it's necessary to send more information on client init, the calling code can always skip this and set the transport itself.
type Board ¶
type Board struct { ID int `json:"id,omitempty" structs:"id,omitempty"` Self string `json:"self,omitempty" structs:"self,omitempty"` Name string `json:"name,omitempty" structs:"name,omitemtpy"` Type string `json:"type,omitempty" structs:"type,omitempty"` FilterID int `json:"filterId,omitempty" structs:"filterId,omitempty"` }
Board represents a Jira agile board
type BoardConfiguration ¶
type BoardConfiguration struct { ID int `json:"id"` Name string `json:"name"` Self string `json:"self"` Location BoardConfigurationLocation `json:"location"` Filter BoardConfigurationFilter `json:"filter"` SubQuery BoardConfigurationSubQuery `json:"subQuery"` ColumnConfig BoardConfigurationColumnConfig `json:"columnConfig"` }
BoardConfiguration represents a boardConfiguration of a jira board
type BoardConfigurationColumn ¶
type BoardConfigurationColumn struct { Name string `json:"name"` Status []BoardConfigurationColumnStatus `json:"statuses"` Min int `json:"min,omitempty"` Max int `json:"max,omitempty"` }
BoardConfigurationColumn lists the name of the board with the statuses that maps to a particular column
type BoardConfigurationColumnConfig ¶
type BoardConfigurationColumnConfig struct { Columns []BoardConfigurationColumn `json:"columns"` ConstraintType string `json:"constraintType"` }
BoardConfigurationColumnConfig lists the columns for a given board in the order defined in the column configuration with constrainttype (none, issueCount, issueCountExclSubs)
type BoardConfigurationColumnStatus ¶
BoardConfigurationColumnStatus represents a status in the column configuration
type BoardConfigurationFilter ¶
BoardConfigurationFilter reference to the filter used by the given board.
type BoardConfigurationLocation ¶
type BoardConfigurationLocation struct { Type string `json:"type"` Key string `json:"key"` ID string `json:"id"` Self string `json:"self"` Name string `json:"name"` }
BoardConfigurationLocation reference to the container that the board is located in
type BoardConfigurationSubQuery ¶
type BoardConfigurationSubQuery struct {
Query string `json:"query"`
}
BoardConfigurationSubQuery (Kanban only) - JQL subquery used by the given board.
type BoardListOptions ¶
type BoardListOptions struct { // BoardType filters results to boards of the specified type. // Valid values: scrum, kanban. BoardType string `url:"type,omitempty"` // Name filters results to boards that match or partially match the specified name. Name string `url:"name,omitempty"` // ProjectKeyOrID filters results to boards that are relevant to a project. // Relevance meaning that the JQL filter defined in board contains a reference to a project. ProjectKeyOrID string `url:"projectKeyOrId,omitempty"` SearchOptions }
BoardListOptions specifies the optional parameters to the BoardService.GetList
type BoardService ¶
type BoardService service
BoardService handles Agile Boards for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira-software/REST/server/
func (*BoardService) CreateBoard ¶
CreateBoard creates a new board. Board name, type and filter Id is required. name - Must be less than 255 characters. type - Valid values: scrum, kanban filterId - Id of a filter that the user has permissions to view. Note, if the user does not have the 'Create shared objects' permission and tries to create a shared board, a private board will be created instead (remember that board sharing depends on the filter sharing).
Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-createBoard
func (*BoardService) DeleteBoard ¶
DeleteBoard will delete an agile board.
Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-deleteBoard Caller must close resp.Body
func (*BoardService) GetAllBoards ¶
func (s *BoardService) GetAllBoards(ctx context.Context, opt *BoardListOptions) (*BoardsList, *Response, error)
GetAllBoards will returns all boards. This only includes boards that the user has permission to view.
Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getAllBoards
func (*BoardService) GetAllSprints ¶
func (s *BoardService) GetAllSprints(ctx context.Context, boardID int, options *GetAllSprintsOptions) (*SprintsList, *Response, error)
GetAllSprints returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to view.
Jira API docs: https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-sprint-get
func (*BoardService) GetBoard ¶
GetBoard will returns the board for the given boardID. This board will only be returned if the user has permission to view it.
Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getBoard
func (*BoardService) GetBoardConfiguration ¶
func (s *BoardService) GetBoardConfiguration(ctx context.Context, boardID int) (*BoardConfiguration, *Response, error)
GetBoardConfiguration will return a board configuration for a given board Id Jira API docs:https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-board-boardId-configuration-get
type BoardsList ¶
type BoardsList struct { MaxResults int `json:"maxResults" structs:"maxResults"` StartAt int `json:"startAt" structs:"startAt"` Total int `json:"total" structs:"total"` IsLast bool `json:"isLast" structs:"isLast"` Values []Board `json:"values" structs:"values"` }
BoardsList reflects a list of agile boards
type Changelog ¶
type Changelog struct {
Histories []ChangelogHistory `json:"histories,omitempty"`
}
Changelog reflects the change log of an issue
type ChangelogHistory ¶
type ChangelogHistory struct { Id string `json:"id" structs:"id"` Author User `json:"author" structs:"author"` Created string `json:"created" structs:"created"` Items []ChangelogItems `json:"items" structs:"items"` }
ChangelogHistory reflects one single changelog history entry
func (ChangelogHistory) CreatedTime ¶
func (c ChangelogHistory) CreatedTime() (time.Time, error)
type ChangelogItems ¶
type ChangelogItems struct { Field string `json:"field" structs:"field"` FieldType string `json:"fieldtype" structs:"fieldtype"` From interface{} `json:"from" structs:"from"` FromString string `json:"fromString" structs:"fromString"` To interface{} `json:"to" structs:"to"` ToString string `json:"toString" structs:"toString"` }
ChangelogItems reflects one single changelog item of a history item
type Client ¶
type Client struct { // Base URL for API requests. // Should be set to a domain endpoint of the Jira instance. // BaseURL should always be specified with a trailing slash. BaseURL *url.URL // User agent used when communicating with the Jira API. UserAgent string // Services used for talking to different parts of the Jira API. Authentication *AuthenticationService Issue *IssueService Project *ProjectService Board *BoardService Sprint *SprintService User *UserService Group *GroupService Version *VersionService Priority *PriorityService Field *FieldService Component *ComponentService Resolution *ResolutionService StatusCategory *StatusCategoryService Filter *FilterService Role *RoleService PermissionScheme *PermissionSchemeService Status *StatusService IssueLinkType *IssueLinkTypeService Organization *OrganizationService ServiceDesk *ServiceDeskService Customer *CustomerService Request *RequestService // contains filtered or unexported fields }
A Client manages communication with the Jira API.
func NewClient ¶
NewClient returns a new Jira API client with provided base URL (often is your Jira hostname) If a nil httpClient is provided, a new http.Client will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library). baseURL is the HTTP endpoint of your Jira instance and should always be specified with a trailing slash.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.
func (*Client) NewMultiPartRequest ¶
func (c *Client) NewMultiPartRequest(ctx context.Context, method, urlStr string, buf *bytes.Buffer) (*http.Request, error)
NewMultiPartRequest creates an API request including a multi-part file. A relative URL can be provided in urlStr, in which case it is resolved relative to the baseURL of the Client. If specified, the value pointed to by buf is a multipart form.
func (*Client) NewRawRequest ¶
func (c *Client) NewRawRequest(ctx context.Context, method, urlStr string, body io.Reader) (*http.Request, error)
TODO Do we need it? NewRawRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the baseURL of the Client. Allows using an optional native io.Reader for sourcing the request body.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. If specified, the value pointed to by body is JSON encoded and included as the request body.
type Comment ¶
type Comment struct { ID string `json:"id,omitempty" structs:"id,omitempty"` Self string `json:"self,omitempty" structs:"self,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Author User `json:"author,omitempty" structs:"author,omitempty"` Body string `json:"body,omitempty" structs:"body,omitempty"` UpdateAuthor User `json:"updateAuthor,omitempty" structs:"updateAuthor,omitempty"` Updated string `json:"updated,omitempty" structs:"updated,omitempty"` Created string `json:"created,omitempty" structs:"created,omitempty"` Visibility CommentVisibility `json:"visibility,omitempty" structs:"visibility,omitempty"` }
Comment represents a comment by a person to an issue in Jira.
type CommentVisibility ¶
type CommentVisibility struct { Type string `json:"type,omitempty" structs:"type,omitempty"` Value string `json:"value,omitempty" structs:"value,omitempty"` }
CommentVisibility represents he visibility of a comment. E.g. Type could be "role" and Value "Administrators"
type Comments ¶
type Comments struct {
Comments []*Comment `json:"comments,omitempty" structs:"comments,omitempty"`
}
Comments represents a list of Comment.
type Component ¶
type Component struct { Self string `json:"self,omitempty" structs:"self,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` }
Component represents a "component" of a Jira issue. Components can be user defined in every Jira instance.
type ComponentService ¶
type ComponentService service
ComponentService handles components for the Jira instance / API.// Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/7.10.1/#api/2/component
func (*ComponentService) Create ¶
func (s *ComponentService) Create(ctx context.Context, options *CreateComponentOptions) (*ProjectComponent, *Response, error)
Create creates a new Jira component based on the given options.
type CookieAuthTransport ¶
type CookieAuthTransport struct { Username string Password string AuthURL string // SessionObject is the authenticated cookie string.s // It's passed in each call to prove the client is authenticated. SessionObject []*http.Cookie // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
CookieAuthTransport is an http.RoundTripper that authenticates all requests using Jira's cookie-based authentication.
Note that it is generally preferable to use HTTP BASIC authentication with the REST API. However, this resource may be used to mimic the behaviour of Jira's log-in page (e.g. to display log-in errors to a user).
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
func (*CookieAuthTransport) Client ¶
func (t *CookieAuthTransport) Client() *http.Client
Client returns an *http.Client that makes requests that are authenticated using cookie authentication
type CreateComponentOptions ¶
type CreateComponentOptions struct { Name string `json:"name,omitempty" structs:"name,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` Lead *User `json:"lead,omitempty" structs:"lead,omitempty"` LeadUserName string `json:"leadUserName,omitempty" structs:"leadUserName,omitempty"` AssigneeType string `json:"assigneeType,omitempty" structs:"assigneeType,omitempty"` Assignee *User `json:"assignee,omitempty" structs:"assignee,omitempty"` Project string `json:"project,omitempty" structs:"project,omitempty"` ProjectID int `json:"projectId,omitempty" structs:"projectId,omitempty"` }
CreateComponentOptions are passed to the ComponentService.Create function to create a new Jira component
type CreateMetaInfo ¶
type CreateMetaInfo struct { Expand string `json:"expand,omitempty"` Projects []*MetaProject `json:"projects,omitempty"` }
CreateMetaInfo contains information about fields and their attributed to create a ticket.
func (*CreateMetaInfo) GetProjectWithKey ¶
func (m *CreateMetaInfo) GetProjectWithKey(key string) *MetaProject
GetProjectWithKey returns a project with "name" from the meta information received. If not found, this returns nil. The comparison of the name is case insensitive.
func (*CreateMetaInfo) GetProjectWithName ¶
func (m *CreateMetaInfo) GetProjectWithName(name string) *MetaProject
GetProjectWithName returns a project with "name" from the meta information received. If not found, this returns nil. The comparison of the name is case insensitive.
type CreateTransitionPayload ¶
type CreateTransitionPayload struct { Update TransitionPayloadUpdate `json:"update,omitempty" structs:"update,omitempty"` Transition TransitionPayload `json:"transition" structs:"transition"` Fields TransitionPayloadFields `json:"fields" structs:"fields"` }
CreateTransitionPayload is used for creating new issue transitions
type CustomFields ¶
CustomFields represents custom fields of Jira This can heavily differ between Jira instances
type Customer ¶
type Customer struct { AccountID string `json:"accountId,omitempty" structs:"accountId,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Key string `json:"key,omitempty" structs:"key,omitempty"` EmailAddress string `json:"emailAddress,omitempty" structs:"emailAddress,omitempty"` DisplayName string `json:"displayName,omitempty" structs:"displayName,omitempty"` Active *bool `json:"active,omitempty" structs:"active,omitempty"` TimeZone string `json:"timeZone,omitempty" structs:"timeZone,omitempty"` Links *SelfLink `json:"_links,omitempty" structs:"_links,omitempty"` }
Customer represents a ServiceDesk customer.
type CustomerList ¶
type CustomerList struct { Values []Customer `json:"values,omitempty" structs:"values,omitempty"` Start int `json:"start,omitempty" structs:"start,omitempty"` Limit int `json:"limit,omitempty" structs:"limit,omitempty"` IsLast bool `json:"isLastPage,omitempty" structs:"isLastPage,omitempty"` Expands []string `json:"_expands,omitempty" structs:"_expands,omitempty"` }
CustomerList is a page of customers.
type CustomerListOptions ¶
type CustomerListOptions struct { Query string `url:"query,omitempty"` Start int `url:"start,omitempty"` Limit int `url:"limit,omitempty"` }
CustomerListOptions is the query options for listing customers.
type CustomerService ¶
type CustomerService service
CustomerService handles ServiceDesk customers for the Jira instance / API.
type Date ¶
Date represents the Date definition of Jira as a time.Time of go
func (Date) MarshalJSON ¶
MarshalJSON will transform the Date object into a short date string as Jira expects during the creation of a Jira request
func (*Date) UnmarshalJSON ¶
UnmarshalJSON will transform the Jira date into a time.Time during the transformation of the Jira JSON response
type EditMetaInfo ¶
type EditMetaInfo struct {
Fields tcontainer.MarshalMap `json:"fields,omitempty"`
}
EditMetaInfo contains information about fields and their attributed to edit a ticket.
type EntityProperty ¶
type EntityProperty struct { Key string `json:"key"` Value interface{} `json:"value"` }
type Epic ¶
type Epic struct { ID int `json:"id" structs:"id"` Key string `json:"key" structs:"key"` Self string `json:"self" structs:"self"` Name string `json:"name" structs:"name"` Summary string `json:"summary" structs:"summary"` Done bool `json:"done" structs:"done"` }
Epic represents the epic to which an issue is associated Not that this struct does not process the returned "color" value
type Error ¶
type Error struct { HTTPError error ErrorMessages []string `json:"errorMessages"` Errors map[string]string `json:"errors"` }
Error message from Jira See https://docs.atlassian.com/jira/REST/cloud/#error-responses
type Field ¶
type Field struct { ID string `json:"id,omitempty" structs:"id,omitempty"` Key string `json:"key,omitempty" structs:"key,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Custom bool `json:"custom,omitempty" structs:"custom,omitempty"` Searchable bool `json:"searchable,omitempty" structs:"searchable,omitempty"` ClauseNames []string `json:"clauseNames,omitempty" structs:"clauseNames,omitempty"` Schema FieldSchema `json:"schema,omitempty" structs:"schema,omitempty"` }
Field represents a field of a Jira issue.
type FieldSchema ¶
type FieldSchema struct { Type string `json:"type,omitempty" structs:"type,omitempty"` Items string `json:"items,omitempty" structs:"items,omitempty"` Custom string `json:"custom,omitempty" structs:"custom,omitempty"` System string `json:"system,omitempty" structs:"system,omitempty"` CustomID int64 `json:"customId,omitempty" structs:"customId,omitempty"` }
FieldSchema represents a schema of a Jira field. Documentation: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-fields/#api-rest-api-2-field-get
type FieldService ¶
type FieldService service
FieldService handles fields for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Field
func (*FieldService) GetList ¶
GetList gets all fields from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-field-get
type Filter ¶
type Filter struct { Self string `json:"self"` ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Owner User `json:"owner"` Jql string `json:"jql"` ViewURL string `json:"viewUrl"` SearchURL string `json:"searchUrl"` Favourite bool `json:"favourite"` FavouritedCount int `json:"favouritedCount"` Subscriptions struct { Size int `json:"size"` Items []interface{} `json:"items"` MaxResults int `json:"max-results"` StartIndex int `json:"start-index"` EndIndex int `json:"end-index"` } `json:"subscriptions"` }
Filter represents a Filter in Jira
type FilterSearchOptions ¶
type FilterSearchOptions struct { // String used to perform a case-insensitive partial match with name. FilterName string `url:"filterName,omitempty"` // User account ID used to return filters with the matching owner.accountId. This parameter cannot be used with owner. AccountID string `url:"accountId,omitempty"` // Group name used to returns filters that are shared with a group that matches sharePermissions.group.groupname. GroupName string `url:"groupname,omitempty"` // Project ID used to returns filters that are shared with a project that matches sharePermissions.project.id. // Format: int64 ProjectID int64 `url:"projectId,omitempty"` // Orders the results using one of these filter properties. // - `description` Orders by filter `description`. Note that this ordering works independently of whether the expand to display the description field is in use. // - `favourite_count` Orders by `favouritedCount`. // - `is_favourite` Orders by `favourite`. // - `id` Orders by filter `id`. // - `name` Orders by filter `name`. // - `owner` Orders by `owner.accountId`. // // Default: `name` // // Valid values: id, name, description, owner, favorite_count, is_favorite, -id, -name, -description, -owner, -favorite_count, -is_favorite OrderBy string `url:"orderBy,omitempty"` // The index of the first item to return in a page of results (page offset). // Default: 0, Format: int64 StartAt int64 `url:"startAt,omitempty"` // The maximum number of items to return per page. The maximum is 100. // Default: 50, Format: int32 MaxResults int32 `url:"maxResults,omitempty"` // Use expand to include additional information about filter in the response. This parameter accepts multiple values separated by a comma: // - description Returns the description of the filter. // - favourite Returns an indicator of whether the user has set the filter as a favorite. // - favouritedCount Returns a count of how many users have set this filter as a favorite. // - jql Returns the JQL query that the filter uses. // - owner Returns the owner of the filter. // - searchUrl Returns a URL to perform the filter's JQL query. // - sharePermissions Returns the share permissions defined for the filter. // - subscriptions Returns the users that are subscribed to the filter. // - viewUrl Returns a URL to view the filter. Expand string `url:"expand,omitempty"` }
FilterSearchOptions specifies the optional parameters for the Search method https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-filter-search-get
type FilterService ¶
type FilterService service
FilterService handles fields for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Filter
func (*FilterService) GetFavouriteList ¶
GetFavouriteList retrieves the user's favourited filters from Jira
func (*FilterService) GetMyFilters ¶
func (fs *FilterService) GetMyFilters(ctx context.Context, opts *GetMyFiltersQueryOptions) ([]*Filter, *Response, error)
GetMyFilters retrieves the my Filters.
https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-filter-my-get
func (*FilterService) Search ¶
func (fs *FilterService) Search(ctx context.Context, opt *FilterSearchOptions) (*FiltersList, *Response, error)
Search will search for filter according to the search options
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-filter-search-get
type FiltersList ¶
type FiltersList struct { MaxResults int `json:"maxResults" structs:"maxResults"` StartAt int `json:"startAt" structs:"startAt"` Total int `json:"total" structs:"total"` IsLast bool `json:"isLast" structs:"isLast"` Values []FiltersListItem `json:"values" structs:"values"` }
FiltersList reflects a list of filters
type FiltersListItem ¶
type FiltersListItem struct { Self string `json:"self"` ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Owner User `json:"owner"` Jql string `json:"jql"` ViewURL string `json:"viewUrl"` SearchURL string `json:"searchUrl"` Favourite bool `json:"favourite"` FavouritedCount int `json:"favouritedCount"` Subscriptions []struct { ID int `json:"id"` User User `json:"user"` } `json:"subscriptions"` }
FiltersListItem represents a Filter of FiltersList in Jira
type FixVersion ¶
type FixVersion struct { Self string `json:"self,omitempty" structs:"self,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` Archived *bool `json:"archived,omitempty" structs:"archived,omitempty"` Released *bool `json:"released,omitempty" structs:"released,omitempty"` ReleaseDate string `json:"releaseDate,omitempty" structs:"releaseDate,omitempty"` UserReleaseDate string `json:"userReleaseDate,omitempty" structs:"userReleaseDate,omitempty"` ProjectID int `json:"projectId,omitempty" structs:"projectId,omitempty"` // Unlike other IDs, this is returned as a number StartDate string `json:"startDate,omitempty" structs:"startDate,omitempty"` }
FixVersion represents a software release in which an issue is fixed.
type GetAllSprintsOptions ¶
type GetAllSprintsOptions struct { // State filters results to sprints in the specified states, comma-separate list State string `url:"state,omitempty"` SearchOptions }
GetAllSprintsOptions specifies the optional parameters to the BoardService.GetList
type GetGroupMembersResult ¶ added in v1.0.2
type GetGroupMembersResult struct { Name string `json:"name"` Self string `json:"self"` Expand string `json:"expand"` Users GroupMembersUsers `json:"users"` }
type GetMyFiltersQueryOptions ¶
type GetMyFiltersQueryOptions struct { IncludeFavourites bool `url:"includeFavourites,omitempty"` Expand string `url:"expand,omitempty"` }
GetMyFiltersQueryOptions specifies the optional parameters for the Get My Filters method
type GetQueryOptions ¶
type GetQueryOptions struct { // Fields is the list of fields to return for the issue. By default, all fields are returned. Fields string `url:"fields,omitempty"` Expand string `url:"expand,omitempty"` // Properties is the list of properties to return for the issue. By default no properties are returned. Properties string `url:"properties,omitempty"` // FieldsByKeys if true then fields in issues will be referenced by keys instead of ids FieldsByKeys bool `url:"fieldsByKeys,omitempty"` UpdateHistory bool `url:"updateHistory,omitempty"` ProjectKeys string `url:"projectKeys,omitempty"` }
GetQueryOptions specifies the optional parameters for the Get Issue methods
type GetWorklogsQueryOptions ¶
type GetWorklogsQueryOptions struct { StartAt int64 `url:"startAt,omitempty"` MaxResults int32 `url:"maxResults,omitempty"` StartedAfter int64 `url:"startedAfter,omitempty"` Expand string `url:"expand,omitempty"` }
GetWorklogsQueryOptions specifies the optional parameters for the Get Worklogs method
type Group ¶
type Group struct { ID string `json:"id"` Title string `json:"title"` Type string `json:"type"` Properties groupProperties `json:"properties"` AdditionalProperties bool `json:"additionalProperties"` }
Group represents a Jira group
type GroupMember ¶
type GroupMember struct { Self string `json:"self,omitempty"` Name string `json:"name,omitempty"` Key string `json:"key,omitempty"` AccountID string `json:"accountId,omitempty"` EmailAddress string `json:"emailAddress,omitempty"` DisplayName string `json:"displayName,omitempty"` Active bool `json:"active,omitempty"` TimeZone string `json:"timeZone,omitempty"` AccountType string `json:"accountType,omitempty"` }
GroupMember reflects a single member of a group
type GroupMembersUsers ¶ added in v1.0.2
type GroupMembersUsers struct { Size int `json:"size"` MaxResults int `json:"max-results"` StartIndex int `json:"start-index"` EndIndex int `json:"end-index"` GroupMembers []GroupMember `json:"items"` }
type GroupMeta ¶
type GroupMeta struct { Name string `json:"name,omitempty"` HTML string `json:"html,omitempty"` Labels []struct { Text string `json:"text,omitempty"` Title string `json:"title,omitempty"` Type string `json:"type,omitempty"` } `json:"labels,omitempty"` }
GroupMeta JIRA v92
type GroupSearchOptions ¶
GroupSearchOptions specifies the optional parameters for the Get Group methods
type GroupService ¶
type GroupService service
GroupService handles Groups for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/server/#api/2/group
func (*GroupService) Add ¶
func (s *GroupService) Add(ctx context.Context, groupname string, username string) (*Group, *Response, error)
Add adds user to group
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/group-addUserToGroup
func (*GroupService) Get ¶
func (s *GroupService) Get(ctx context.Context, name string, options *GroupSearchOptions) ([]GroupMember, *Response, error)
Get returns a paginated list of members of the specified group and its subgroups. Users in the page are ordered by user names. User of this resource is required to have sysadmin or admin permissions.
Jira API docs: https://docs.atlassian.com/jira/REST/server/#api/2/group-getUsersFromGroup
WARNING: This API only returns the first page of group members
func (*GroupService) GetGroupMembers ¶ added in v1.0.2
func (s *GroupService) GetGroupMembers(ctx context.Context, name string) ([]GroupMember, *Response, error)
func (*GroupService) Remove ¶
func (s *GroupService) Remove(ctx context.Context, groupname string, username string) (*Response, error)
Remove removes user from group
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/group-removeUserFromGroup Caller must close resp.Body
type GroupsResult ¶
type GroupsResult struct { Header string `json:"header,omitempty"` Total int `json:"total"` Groups []GroupMeta `json:"groups"` }
GroupsResult JIRA v9.2
type Issue ¶
type Issue struct { Expand string `json:"expand,omitempty" structs:"expand,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` Self string `json:"self,omitempty" structs:"self,omitempty"` Key string `json:"key,omitempty" structs:"key,omitempty"` Fields *IssueFields `json:"fields,omitempty" structs:"fields,omitempty"` RenderedFields *IssueRenderedFields `json:"renderedFields,omitempty" structs:"renderedFields,omitempty"` Changelog *Changelog `json:"changelog,omitempty" structs:"changelog,omitempty"` Transitions []Transition `json:"transitions,omitempty" structs:"transitions,omitempty"` Names map[string]string `json:"names,omitempty" structs:"names,omitempty"` }
Issue represents a Jira issue.
func InitIssueWithMetaAndFields ¶
func InitIssueWithMetaAndFields(metaProject *MetaProject, metaIssuetype *MetaIssueType, fieldsConfig map[string]string) (*Issue, error)
InitIssueWithMetaAndFields returns Issue with with values from fieldsConfig properly set.
- metaProject should contain metaInformation about the project where the issue should be created.
- metaIssuetype is the MetaInformation about the Issuetype that needs to be created.
- fieldsConfig is a key->value pair where key represents the name of the field as seen in the UI And value is the string value for that particular key.
Note: This method doesn't verify that the fieldsConfig is complete with mandatory fields. The fieldsConfig is
supposed to be already verified with MetaIssueType.CheckCompleteAndAvailable. It will however return error if the key is not found. All values will be packed into Unknowns. This is much convenient. If the struct fields needs to be configured as well, marshalling and unmarshalling will set the proper fields.
type IssueFields ¶
type IssueFields struct { // TODO Missing fields // * "workratio": -1, // * "lastViewed": null, // * "environment": null, Expand string `json:"expand,omitempty" structs:"expand,omitempty"` Type IssueType `json:"issuetype,omitempty" structs:"issuetype,omitempty"` Project Project `json:"project,omitempty" structs:"project,omitempty"` Environment string `json:"environment,omitempty" structs:"environment,omitempty"` Resolution *Resolution `json:"resolution,omitempty" structs:"resolution,omitempty"` Priority *Priority `json:"priority,omitempty" structs:"priority,omitempty"` Resolutiondate Time `json:"resolutiondate,omitempty" structs:"resolutiondate,omitempty"` Created Time `json:"created,omitempty" structs:"created,omitempty"` Duedate Date `json:"duedate,omitempty" structs:"duedate,omitempty"` Watches *Watches `json:"watches,omitempty" structs:"watches,omitempty"` Assignee *User `json:"assignee,omitempty" structs:"assignee,omitempty"` Updated Time `json:"updated,omitempty" structs:"updated,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` Summary string `json:"summary,omitempty" structs:"summary,omitempty"` Creator *User `json:"Creator,omitempty" structs:"Creator,omitempty"` Reporter *User `json:"reporter,omitempty" structs:"reporter,omitempty"` Components []*Component `json:"components,omitempty" structs:"components,omitempty"` Status *Status `json:"status,omitempty" structs:"status,omitempty"` Progress *Progress `json:"progress,omitempty" structs:"progress,omitempty"` AggregateProgress *Progress `json:"aggregateprogress,omitempty" structs:"aggregateprogress,omitempty"` TimeTracking *TimeTracking `json:"timetracking,omitempty" structs:"timetracking,omitempty"` TimeSpent int `json:"timespent,omitempty" structs:"timespent,omitempty"` TimeEstimate int `json:"timeestimate,omitempty" structs:"timeestimate,omitempty"` TimeOriginalEstimate int `json:"timeoriginalestimate,omitempty" structs:"timeoriginalestimate,omitempty"` Worklog *Worklog `json:"worklog,omitempty" structs:"worklog,omitempty"` IssueLinks []*IssueLink `json:"issuelinks,omitempty" structs:"issuelinks,omitempty"` Comments *Comments `json:"comment,omitempty" structs:"comment,omitempty"` FixVersions []*FixVersion `json:"fixVersions,omitempty" structs:"fixVersions,omitempty"` AffectsVersions []*AffectsVersion `json:"versions,omitempty" structs:"versions,omitempty"` Labels []string `json:"labels,omitempty" structs:"labels,omitempty"` Subtasks []*Subtasks `json:"subtasks,omitempty" structs:"subtasks,omitempty"` Attachments []*Attachment `json:"attachment,omitempty" structs:"attachment,omitempty"` Epic *Epic `json:"epic,omitempty" structs:"epic,omitempty"` Sprint *Sprint `json:"sprint,omitempty" structs:"sprint,omitempty"` Parent *Parent `json:"parent,omitempty" structs:"parent,omitempty"` AggregateTimeOriginalEstimate int `json:"aggregatetimeoriginalestimate,omitempty" structs:"aggregatetimeoriginalestimate,omitempty"` AggregateTimeSpent int `json:"aggregatetimespent,omitempty" structs:"aggregatetimespent,omitempty"` AggregateTimeEstimate int `json:"aggregatetimeestimate,omitempty" structs:"aggregatetimeestimate,omitempty"` Unknowns tcontainer.MarshalMap }
IssueFields represents single fields of a Jira issue. Every Jira issue has several fields attached.
func (*IssueFields) MarshalJSON ¶
func (i *IssueFields) MarshalJSON() ([]byte, error)
MarshalJSON is a custom JSON marshal function for the IssueFields structs. It handles Jira custom fields and maps those from / to "Unknowns" key.
func (*IssueFields) UnmarshalJSON ¶
func (i *IssueFields) UnmarshalJSON(data []byte) error
UnmarshalJSON is a custom JSON marshal function for the IssueFields structs. It handles Jira custom fields and maps those from / to "Unknowns" key.
type IssueLink ¶
type IssueLink struct { ID string `json:"id,omitempty" structs:"id,omitempty"` Self string `json:"self,omitempty" structs:"self,omitempty"` Type IssueLinkType `json:"type" structs:"type"` OutwardIssue *Issue `json:"outwardIssue" structs:"outwardIssue"` InwardIssue *Issue `json:"inwardIssue" structs:"inwardIssue"` Comment *Comment `json:"comment,omitempty" structs:"comment,omitempty"` }
IssueLink represents a link between two issues in Jira.
type IssueLinkType ¶
type IssueLinkType struct { ID string `json:"id,omitempty" structs:"id,omitempty"` Self string `json:"self,omitempty" structs:"self,omitempty"` Name string `json:"name" structs:"name"` Inward string `json:"inward" structs:"inward"` Outward string `json:"outward" structs:"outward"` }
IssueLinkType represents a type of a link between to issues in Jira. Typical issue link types are "Related to", "Duplicate", "Is blocked by", etc.
type IssueLinkTypeService ¶
type IssueLinkTypeService service
IssueLinkTypeService handles issue link types for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-group-Issue-link-types
func (*IssueLinkTypeService) Create ¶
func (s *IssueLinkTypeService) Create(ctx context.Context, linkType *IssueLinkType) (*IssueLinkType, *Response, error)
Create creates an issue link type in Jira.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issueLinkType-post
func (*IssueLinkTypeService) Delete ¶
Delete deletes an issue link type based on provided ID.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issueLinkType-issueLinkTypeId-delete Caller must close resp.Body
func (*IssueLinkTypeService) Get ¶
func (s *IssueLinkTypeService) Get(ctx context.Context, ID string) (*IssueLinkType, *Response, error)
Get gets info of a specific issue link type from Jira.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issueLinkType-issueLinkTypeId-get
func (*IssueLinkTypeService) GetList ¶
func (s *IssueLinkTypeService) GetList(ctx context.Context) ([]IssueLinkType, *Response, error)
GetList gets all of the issue link types from Jira.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issueLinkType-get
func (*IssueLinkTypeService) Update ¶
func (s *IssueLinkTypeService) Update(ctx context.Context, linkType *IssueLinkType) (*IssueLinkType, *Response, error)
Update updates an issue link type. The issue is found by key.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issueLinkType-issueLinkTypeId-put Caller must close resp.Body
type IssueRenderedFields ¶
type IssueRenderedFields struct { // TODO Missing fields // * "aggregatetimespent": null, // * "workratio": -1, // * "lastViewed": null, // * "aggregatetimeoriginalestimate": null, // * "aggregatetimeestimate": null, // * "environment": null, Resolutiondate string `json:"resolutiondate,omitempty" structs:"resolutiondate,omitempty"` Created string `json:"created,omitempty" structs:"created,omitempty"` Duedate string `json:"duedate,omitempty" structs:"duedate,omitempty"` Updated string `json:"updated,omitempty" structs:"updated,omitempty"` Comments *Comments `json:"comment,omitempty" structs:"comment,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` }
IssueRenderedFields represents rendered fields of a Jira issue. Not all IssueFields are rendered.
type IssueService ¶
type IssueService service
IssueService handles Issues for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue
func (*IssueService) AddComment ¶
func (s *IssueService) AddComment(ctx context.Context, issueID string, comment *Comment) (*Comment, *Response, error)
AddComment adds a new comment to issueID.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-addComment
func (*IssueService) AddLink ¶
AddLink adds a link between two issues.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issueLink Caller must close resp.Body
func (*IssueService) AddRemoteLink ¶
func (s *IssueService) AddRemoteLink(ctx context.Context, issueID string, remotelink *RemoteLink) (*RemoteLink, *Response, error)
AddRemoteLink adds a remote link to issueID.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-remotelink-post
func (*IssueService) AddWatcher ¶
func (s *IssueService) AddWatcher(ctx context.Context, issueID string, userName string) (*Response, error)
AddWatcher adds watcher to the given issue
Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-addWatcher Caller must close resp.Body
func (*IssueService) AddWorklogRecord ¶
func (s *IssueService) AddWorklogRecord(ctx context.Context, issueID string, record *WorklogRecord, options ...func(*http.Request) error) (*WorklogRecord, *Response, error)
AddWorklogRecord adds a new worklog record to issueID.
https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-issueIdOrKey-worklog-post
func (*IssueService) Create ¶
Create creates an issue or a sub-task from a JSON representation. Creating a sub-task is similar to creating a regular issue, with two important differences: The issueType field must correspond to a sub-task issue type and you must provide a parent field in the issue create request containing the id or key of the parent issue.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-createIssues
func (*IssueService) DeleteAttachment ¶
func (s *IssueService) DeleteAttachment(ctx context.Context, attachmentID string) (*Response, error)
DeleteAttachment deletes an attachment of a given attachmentID Caller must close resp.Body
func (*IssueService) DeleteComment ¶
func (s *IssueService) DeleteComment(ctx context.Context, issueID, commentID string) error
DeleteComment Deletes a comment from an issueID.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-issue-issueIdOrKey-comment-id-delete
func (*IssueService) DeleteLink ¶
DeleteLink deletes a link of a given linkID Caller must close resp.Body
func (*IssueService) DoTransition ¶
func (s *IssueService) DoTransition(ctx context.Context, ticketID, transitionID string) (*Response, error)
DoTransition performs a transition on an issue. When performing the transition you can update or set other issue fields.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-doTransition
func (*IssueService) DoTransitionWithPayload ¶
func (s *IssueService) DoTransitionWithPayload(ctx context.Context, ticketID, payload interface{}) (*Response, error)
DoTransitionWithPayload performs a transition on an issue using any payload. When performing the transition you can update or set other issue fields.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-doTransition Caller must close resp.Body
func (*IssueService) DownloadAttachment ¶
func (s *IssueService) DownloadAttachment(ctx context.Context, attachmentID string) (*Response, error)
DownloadAttachment returns a Response of an attachment for a given attachmentID. The attachment is in the Response.Body of the response. This is an io.ReadCloser. Caller must close resp.Body.
func (*IssueService) Get ¶
func (s *IssueService) Get(ctx context.Context, issueID string, options *GetQueryOptions) (*Issue, *Response, error)
Get returns a full representation of the issue for the given issue key. Jira will attempt to identify the issue by the issueIdOrKey path parameter. This can be an issue id, or an issue key. If the issue cannot be found via an exact match, Jira will also look for the issue in a case-insensitive way, or by looking to see if the issue was moved.
The given options will be appended to the query string ¶
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-getIssue
func (*IssueService) GetCreateMeta ¶
func (s *IssueService) GetCreateMeta(ctx context.Context, options *GetQueryOptions) (*CreateMetaInfo, *Response, error)
GetCreateMeta makes the api call to get the meta information without requiring to have a projectKey
func (*IssueService) GetCustomFields ¶
func (s *IssueService) GetCustomFields(ctx context.Context, issueID string) (CustomFields, *Response, error)
GetCustomFields returns a map of customfield_* keys with string values
func (*IssueService) GetEditMeta ¶
func (s *IssueService) GetEditMeta(ctx context.Context, issue *Issue) (*EditMetaInfo, *Response, error)
GetEditMeta makes the api call to get the edit meta information for an issue
func (*IssueService) GetProjectIssueFields ¶
func (s *IssueService) GetProjectIssueFields(ctx context.Context, projectIdOrKey string, issueTypeID string) ([]ProjectIssueField, *Response, error)
GetProjectIssueFields JIRA v9.2
func (*IssueService) GetProjectIssueTypes ¶
func (s *IssueService) GetProjectIssueTypes(ctx context.Context, projectIdOrKey string) ([]MetaIssueType, *Response, error)
GetProjectIssueTypes JIRA v9.2
func (*IssueService) GetRemoteLinks ¶
func (s *IssueService) GetRemoteLinks(ctx context.Context, id string) (*[]RemoteLink, *Response, error)
GetRemoteLinks gets remote issue links on the issue.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-getRemoteIssueLinks
func (*IssueService) GetTransitions ¶
func (s *IssueService) GetTransitions(ctx context.Context, id string) ([]Transition, *Response, error)
GetTransitions gets a list of the transitions possible for this issue by the current user, along with fields that are required and their types.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-getTransitions
func (*IssueService) GetWatchers ¶
GetWatchers wil return all the users watching/observing the given issue
Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getIssueWatchers
func (*IssueService) GetWorklogs ¶
func (s *IssueService) GetWorklogs(ctx context.Context, issueID string, options ...func(*http.Request) error) (*Worklog, *Response, error)
GetWorklogs gets all the worklogs for an issue. This method is especially important if you need to read all the worklogs, not just the first page.
https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/worklog-getIssueWorklog
func (*IssueService) PostAttachment ¶
func (s *IssueService) PostAttachment(ctx context.Context, issueID string, r io.Reader, attachmentName string) (*[]Attachment, *Response, error)
PostAttachment uploads r (io.Reader) as an attachment to a given issueID
func (*IssueService) RemoveWatcher ¶
func (s *IssueService) RemoveWatcher(ctx context.Context, issueID string, userName string) (*Response, error)
RemoveWatcher removes given user from given issue
Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-removeWatcher Caller must close resp.Body
func (*IssueService) Search ¶
func (s *IssueService) Search(ctx context.Context, jql string, options *SearchOptions) ([]Issue, *Response, error)
Search will search for tickets according to the jql
Jira API docs: https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-query-issues
func (*IssueService) SearchPages ¶
func (s *IssueService) SearchPages(ctx context.Context, jql string, options *SearchOptions, f func(Issue) error) error
SearchPages will get issues from all pages in a search
Jira API docs: https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-query-issues
func (*IssueService) Update ¶
func (s *IssueService) Update(ctx context.Context, issue *Issue, opts *UpdateQueryOptions) (*Issue, *Response, error)
Update updates an issue from a JSON representation, while also specifying query params. The issue is found by key.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-put Caller must close resp.Body
func (*IssueService) UpdateAssignee ¶
func (s *IssueService) UpdateAssignee(ctx context.Context, issueID string, assignee *User) (*Response, error)
UpdateAssignee updates the user assigned to work on the given issue
Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/7.10.2/#api/2/issue-assign Caller must close resp.Body
func (*IssueService) UpdateComment ¶
func (s *IssueService) UpdateComment(ctx context.Context, issueID string, comment *Comment) (*Comment, *Response, error)
UpdateComment updates the body of a comment, identified by comment.ID, on the issueID.
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/comment-updateComment
func (*IssueService) UpdateIssue ¶
func (s *IssueService) UpdateIssue(ctx context.Context, jiraID string, data map[string]interface{}) (*Response, error)
UpdateIssue updates an issue from a JSON representation. The issue is found by key.
https://docs.atlassian.com/jira/REST/7.4.0/#api/2/issue-editIssue Caller must close resp.Body
func (*IssueService) UpdateRemoteLink ¶
func (s *IssueService) UpdateRemoteLink(ctx context.Context, issueID string, linkID int, remotelink *RemoteLink) (*Response, error)
UpdateRemoteLink updates a remote issue link by linkID.
func (*IssueService) UpdateWorklogRecord ¶
func (s *IssueService) UpdateWorklogRecord(ctx context.Context, issueID, worklogID string, record *WorklogRecord, options ...func(*http.Request) error) (*WorklogRecord, *Response, error)
UpdateWorklogRecord updates a worklog record.
https://docs.atlassian.com/software/jira/docs/api/REST/7.1.2/#api/2/issue-updateWorklog
type IssueType ¶
type IssueType struct { Self string `json:"self,omitempty" structs:"self,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` IconURL string `json:"iconUrl,omitempty" structs:"iconUrl,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Subtask bool `json:"subtask,omitempty" structs:"subtask,omitempty"` AvatarID int `json:"avatarId,omitempty" structs:"avatarId,omitempty"` }
IssueType represents a type of a Jira issue. Typical types are "Request", "Bug", "Story", ...
type IssuesInSprintResult ¶
type IssuesInSprintResult struct {
Issues []Issue `json:"issues"`
}
IssuesInSprintResult represents a wrapper struct for search result
type IssuesWrapper ¶
type IssuesWrapper struct {
Issues []string `json:"issues"`
}
IssuesWrapper represents a wrapper struct for moving issues to sprint
type JWTAuthTransport ¶
type JWTAuthTransport struct { Secret []byte Issuer string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
JWTAuthTransport is an http.RoundTripper that authenticates all requests using Jira's JWT based authentication.
NOTE: this form of auth should be used by add-ons installed from the Atlassian marketplace.
Jira docs: https://developer.atlassian.com/cloud/jira/platform/understanding-jwt Examples in other languages:
https://bitbucket.org/atlassian/atlassian-jwt-ruby/src/d44a8e7a4649e4f23edaa784402655fda7c816ea/lib/atlassian/jwt.rb https://bitbucket.org/atlassian/atlassian-jwt-py/src/master/atlassian_jwt/url_utils.py
func (*JWTAuthTransport) Client ¶
func (t *JWTAuthTransport) Client() *http.Client
type MetaIssueType ¶
type MetaIssueType struct { Self string `json:"self,omitempty"` Id string `json:"id,omitempty"` Description string `json:"description,omitempty"` IconUrl string `json:"iconurl,omitempty"` Name string `json:"name,omitempty"` Subtasks bool `json:"subtask,omitempty"` Expand string `json:"expand,omitempty"` Fields tcontainer.MarshalMap `json:"fields,omitempty"` }
MetaIssueType represents the different issue types a project has.
Note: Fields is interface because this is an object which can have arbitraty keys related to customfields. It is not possible to expect these for a general way. This will be returning a map. Further processing must be done depending on what is required.
func (*MetaIssueType) CheckCompleteAndAvailable ¶
func (t *MetaIssueType) CheckCompleteAndAvailable(config map[string]string) (bool, error)
CheckCompleteAndAvailable checks if the given fields satisfies the mandatory field required to create a issue for the given type And also if the given fields are available.
func (*MetaIssueType) GetAllFields ¶
func (t *MetaIssueType) GetAllFields() (map[string]string, error)
GetAllFields returns a map of all the fields for an IssueType. This includes all required and not required. The key of the returned map is what you see in the form and the value is how it is representated in the jira schema.
func (*MetaIssueType) GetMandatoryFields ¶
func (t *MetaIssueType) GetMandatoryFields() (map[string]string, error)
GetMandatoryFields returns a map of all the required fields from the MetaIssueTypes. if a field returned by the api was:
"customfield_10806": { "required": true, "schema": { "type": "any", "custom": "com.pyxis.greenhopper.jira:gh-epic-link", "customId": 10806 }, "name": "Epic Link", "hasDefaultValue": false, "operations": [ "set" ] }
the returned map would have "Epic Link" as the key and "customfield_10806" as value. This choice has been made so that the it is easier to generate the create api request later.
type MetaProject ¶
type MetaProject struct { Expand string `json:"expand,omitempty"` Self string `json:"self,omitempty"` Id string `json:"id,omitempty"` Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` // omitted avatarUrls IssueTypes []*MetaIssueType `json:"issuetypes,omitempty"` }
MetaProject is the meta information about a project returned from createmeta api
func (*MetaProject) GetIssueTypeWithName ¶
func (p *MetaProject) GetIssueTypeWithName(name string) *MetaIssueType
GetIssueTypeWithName returns an IssueType with name from a given MetaProject. If not found, this returns nil. The comparison of the name is case insensitive
type Option ¶
type Option struct {
Value string `json:"value" structs:"value"`
}
Option represents an option value in a SelectList or MultiSelect custom issue field
type Organization ¶
type Organization struct { ID string `json:"id,omitempty" structs:"id,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Links *SelfLink `json:"_links,omitempty" structs:"_links,omitempty"` }
Organization contains Organization data
type OrganizationCreationDTO ¶
type OrganizationCreationDTO struct {
Name string `json:"name,omitempty" structs:"name,omitempty"`
}
OrganizationCreationDTO is DTO for creat organization API
type OrganizationService ¶
type OrganizationService service
OrganizationService handles Organizations for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/
func (*OrganizationService) AddUsers ¶
func (s *OrganizationService) AddUsers(ctx context.Context, organizationID int, users OrganizationUsersDTO) (*Response, error)
AddUsers adds users to an organization.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-user-post Caller must close resp.Body
func (*OrganizationService) CreateOrganization ¶
func (s *OrganizationService) CreateOrganization(ctx context.Context, name string) (*Organization, *Response, error)
CreateOrganization creates an organization by passing the name of the organization.
Jira API docs: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-post
func (*OrganizationService) DeleteOrganization ¶
func (s *OrganizationService) DeleteOrganization(ctx context.Context, organizationID int) (*Response, error)
DeleteOrganization deletes an organization. Note that the organization is deleted regardless of other associations it may have. For example, associations with service desks.
Jira API docs: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-delete Caller must close resp.Body
func (*OrganizationService) DeleteProperty ¶
func (s *OrganizationService) DeleteProperty(ctx context.Context, organizationID int, propertyKey string) (*Response, error)
DeleteProperty removes a property from an organization.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-property-propertykey-delete Caller must close resp.Body
func (*OrganizationService) GetAllOrganizations ¶
func (s *OrganizationService) GetAllOrganizations(ctx context.Context, start int, limit int, accountID string) (*PagedDTO, *Response, error)
GetAllOrganizations returns a list of organizations in the Jira Service Management instance. Use this method when you want to present a list of organizations or want to locate an organization by name.
Jira API docs: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-group-organization
func (*OrganizationService) GetOrganization ¶
func (s *OrganizationService) GetOrganization(ctx context.Context, organizationID int) (*Organization, *Response, error)
GetOrganization returns details of an organization. Use this method to get organization details whenever your application component is passed an organization ID but needs to display other organization details.
func (*OrganizationService) GetPropertiesKeys ¶
func (s *OrganizationService) GetPropertiesKeys(ctx context.Context, organizationID int) (*PropertyKeys, *Response, error)
GetPropertiesKeys returns the keys of all properties for an organization. Use this resource when you need to find out what additional properties items have been added to an organization.
func (*OrganizationService) GetProperty ¶
func (s *OrganizationService) GetProperty(ctx context.Context, organizationID int, propertyKey string) (*EntityProperty, *Response, error)
GetProperty returns the value of a property from an organization. Use this method to obtain the JSON content for an organization's property.
func (*OrganizationService) GetUsers ¶
func (s *OrganizationService) GetUsers(ctx context.Context, organizationID int, start int, limit int) (*PagedDTO, *Response, error)
GetUsers returns all the users associated with an organization. Use this method where you want to provide a list of users for an organization or determine if a user is associated with an organization.
func (*OrganizationService) RemoveUsers ¶
func (s *OrganizationService) RemoveUsers(ctx context.Context, organizationID int, users OrganizationUsersDTO) (*Response, error)
RemoveUsers removes users from an organization.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-user-delete Caller must close resp.Body
func (*OrganizationService) SetProperty ¶
func (s *OrganizationService) SetProperty(ctx context.Context, organizationID int, propertyKey string) (*Response, error)
SetProperty sets the value of a property for an organization. Use this resource to store custom data against an organization.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-property-propertykey-put Caller must close resp.Body
type OrganizationUsersDTO ¶
type OrganizationUsersDTO struct {
AccountIds []string `json:"accountIds,omitempty" structs:"accountIds,omitempty"`
}
OrganizationUsersDTO contains organization user ids
type PATAuthTransport ¶
type PATAuthTransport struct { // Token is the key that was provided by Jira when creating the Personal Access Token. Token string // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
PATAuthTransport is an http.RoundTripper that authenticates all requests using the Personal Access Token specified. See here for more info: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html
func (*PATAuthTransport) Client ¶
func (t *PATAuthTransport) Client() *http.Client
Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication. This is a nice little bit of sugar so we can just get the client instead of creating the client in the calling code. If it's necessary to send more information on client init, the calling code can always skip this and set the transport itself.
type PagedDTO ¶
type PagedDTO struct { Size int `json:"size,omitempty" structs:"size,omitempty"` Start int `json:"start,omitempty" structs:"start,omitempty"` Limit int `limit:"size,omitempty" structs:"limit,omitempty"` IsLastPage bool `json:"isLastPage,omitempty" structs:"isLastPage,omitempty"` Values []interface{} `values:"isLastPage,omitempty" structs:"values,omitempty"` Expands []string `json:"_expands,omitempty" structs:"_expands,omitempty"` }
PagedDTO is response of a paged list
type Parent ¶
type Parent struct { ID string `json:"id,omitempty" structs:"id,omitempty"` Key string `json:"key,omitempty" structs:"key,omitempty"` }
Parent represents the parent of a Jira issue, to be used with subtask issue types.
type Permission ¶
type PermissionScheme ¶
type PermissionScheme struct { Expand string `json:"expand" structs:"expand,omitempty"` Self string `json:"self" structs:"self,omitempty"` ID int `json:"id" structs:"id,omitempty"` Name string `json:"name" structs:"name,omitempty"` Description string `json:"description" structs:"description,omitempty"` Permissions []Permission `json:"permissions" structs:"permissions,omitempty"` }
PermissionScheme represents the permission scheme for the project
type PermissionSchemeService ¶
type PermissionSchemeService service
PermissionSchemeService handles permissionschemes for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Permissionscheme
func (*PermissionSchemeService) Get ¶
func (s *PermissionSchemeService) Get(ctx context.Context, schemeID int) (*PermissionScheme, *Response, error)
Get returns a full representation of the permission scheme for the schemeID
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-permissionscheme-schemeId-get
func (*PermissionSchemeService) GetList ¶
func (s *PermissionSchemeService) GetList(ctx context.Context) (*PermissionSchemes, *Response, error)
GetList returns a list of all permission schemes
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-permissionscheme-get
type PermissionSchemes ¶
type PermissionSchemes struct {
PermissionSchemes []PermissionScheme `json:"permissionSchemes" structs:"permissionSchemes"`
}
type Priority ¶
type Priority struct { Self string `json:"self,omitempty" structs:"self,omitempty"` IconURL string `json:"iconUrl,omitempty" structs:"iconUrl,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` StatusColor string `json:"statusColor,omitempty" structs:"statusColor,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` }
Priority represents a priority of a Jira issue. Typical types are "Normal", "Moderate", "Urgent", ...
type PriorityService ¶
type PriorityService service
PriorityService handles priorities for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Priority
func (*PriorityService) GetList ¶
GetList gets all priorities from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-priority-get
type Progress ¶
type Progress struct { Progress int `json:"progress" structs:"progress"` Total int `json:"total" structs:"total"` Percent int `json:"percent" structs:"percent"` }
Progress represents the progress of a Jira issue.
type Project ¶
type Project struct { Expand string `json:"expand,omitempty" structs:"expand,omitempty"` Self string `json:"self,omitempty" structs:"self,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` Key string `json:"key,omitempty" structs:"key,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` Lead User `json:"lead,omitempty" structs:"lead,omitempty"` Components []ProjectComponent `json:"components,omitempty" structs:"components,omitempty"` IssueTypes []IssueType `json:"issueTypes,omitempty" structs:"issueTypes,omitempty"` URL string `json:"url,omitempty" structs:"url,omitempty"` Email string `json:"email,omitempty" structs:"email,omitempty"` AssigneeType string `json:"assigneeType,omitempty" structs:"assigneeType,omitempty"` Versions []Version `json:"versions,omitempty" structs:"versions,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Roles map[string]string `json:"roles,omitempty" structs:"roles,omitempty"` AvatarUrls AvatarUrls `json:"avatarUrls,omitempty" structs:"avatarUrls,omitempty"` ProjectCategory ProjectCategory `json:"projectCategory,omitempty" structs:"projectCategory,omitempty"` }
Project represents a Jira Project.
type ProjectCategory ¶
type ProjectCategory struct { Self string `json:"self" structs:"self,omitempty"` ID string `json:"id" structs:"id,omitempty"` Name string `json:"name" structs:"name,omitempty"` Description string `json:"description" structs:"description,omitempty"` }
ProjectCategory represents a single project category
type ProjectComponent ¶
type ProjectComponent struct { Self string `json:"self" structs:"self,omitempty"` ID string `json:"id" structs:"id,omitempty"` Name string `json:"name" structs:"name,omitempty"` Description string `json:"description" structs:"description,omitempty"` Lead User `json:"lead,omitempty" structs:"lead,omitempty"` AssigneeType string `json:"assigneeType" structs:"assigneeType,omitempty"` Assignee User `json:"assignee" structs:"assignee,omitempty"` RealAssigneeType string `json:"realAssigneeType" structs:"realAssigneeType,omitempty"` RealAssignee User `json:"realAssignee" structs:"realAssignee,omitempty"` IsAssigneeTypeValid bool `json:"isAssigneeTypeValid" structs:"isAssigneeTypeValid,omitempty"` Project string `json:"project" structs:"project,omitempty"` ProjectID int `json:"projectId" structs:"projectId,omitempty"` }
ProjectComponent represents a single component of a project
type ProjectIssueField ¶
type ProjectIssueField struct { Required bool `json:"required,omitempty"` Schema FieldSchema `json:"schema,omitempty"` Name string `json:"name,omitempty"` FieldID string `json:"fieldId,omitempty"` HasDefaultValue bool `json:"hasDefaultValue,omitempty"` Operations []string `json:"operations,omitempty"` AllowedValues []AllowedValue `json:"allowedValues,omitempty"` }
ProjectIssueField JIRA v92
type ProjectIssueFieldsResult ¶
type ProjectIssueFieldsResult struct { MaxResults int `json:"maxResults,omitempty"` StartAt int `json:"startAt,omitempty"` Total int `json:"total,omitempty"` IsLast bool `json:"isLast,omitempty"` Values []ProjectIssueField `json:"values,omitempty"` }
ProjectIssueFieldsResult JIRA v92
type ProjectIssueTypesResult ¶
type ProjectIssueTypesResult struct { MaxResults int `json:"maxResults,omitempty"` StartAt int `json:"startAt,omitempty"` Total int `json:"total,omitempty"` IsLast bool `json:"isLast,omitempty"` Values []MetaIssueType `json:"values,omitempty"` }
ProjectIssueTypesResult JIRA v9.2
type ProjectList ¶
type ProjectList []struct { Expand string `json:"expand" structs:"expand"` Self string `json:"self" structs:"self"` ID string `json:"id" structs:"id"` Key string `json:"key" structs:"key"` Name string `json:"name" structs:"name"` AvatarUrls AvatarUrls `json:"avatarUrls" structs:"avatarUrls"` ProjectTypeKey string `json:"projectTypeKey" structs:"projectTypeKey"` ProjectCategory ProjectCategory `json:"projectCategory,omitempty" structs:"projectsCategory,omitempty"` IssueTypes []IssueType `json:"issueTypes,omitempty" structs:"issueTypes,omitempty"` }
ProjectList represent a list of Projects
type ProjectService ¶
type ProjectService service
ProjectService handles projects for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project
func (*ProjectService) Get ¶
Get returns a full representation of the project for the given issue key. Jira will attempt to identify the project by the projectIdOrKey path parameter. This can be an project id, or an project key.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project-getProject
func (*ProjectService) GetAll ¶
func (s *ProjectService) GetAll(ctx context.Context, options *GetQueryOptions) (*ProjectList, *Response, error)
GetAll returns all projects form Jira with optional query params, like &GetQueryOptions{Expand: "issueTypes"} to get a list of all projects and their supported issuetypes.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-projects/#api-rest-api-2-project-get
func (*ProjectService) GetPermissionScheme ¶
func (s *ProjectService) GetPermissionScheme(ctx context.Context, projectID string) (*PermissionScheme, *Response, error)
GetPermissionScheme returns a full representation of the permission scheme for the project Jira will attempt to identify the project by the projectIdOrKey path parameter. This can be an project id, or an project key.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project-getProject
type PropertyKey ¶
type PropertyKey struct { Self string `json:"self,omitempty" structs:"self,omitempty"` Key string `json:"key,omitempty" structs:"key,omitempty"` }
PropertyKey contains Property key details.
type PropertyKeys ¶
type PropertyKeys struct {
Keys []PropertyKey `json:"keys,omitempty" structs:"keys,omitempty"`
}
PropertyKeys contains an array of PropertyKey
type RemoteLink ¶
type RemoteLink struct { ID int `json:"id,omitempty" structs:"id,omitempty"` Self string `json:"self,omitempty" structs:"self,omitempty"` GlobalID string `json:"globalId,omitempty" structs:"globalId,omitempty"` Application *RemoteLinkApplication `json:"application,omitempty" structs:"application,omitempty"` Relationship string `json:"relationship,omitempty" structs:"relationship,omitempty"` Object *RemoteLinkObject `json:"object,omitempty" structs:"object,omitempty"` }
RemoteLink represents remote links which linked to issues
type RemoteLinkApplication ¶
type RemoteLinkApplication struct { Type string `json:"type,omitempty" structs:"type,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` }
RemoteLinkApplication represents remote links application
type RemoteLinkIcon ¶
type RemoteLinkIcon struct { Url16x16 string `json:"url16x16,omitempty" structs:"url16x16,omitempty"` Title string `json:"title,omitempty" structs:"title,omitempty"` Link string `json:"link,omitempty" structs:"link,omitempty"` }
RemoteLinkIcon represents icon displayed next to link
type RemoteLinkObject ¶
type RemoteLinkObject struct { URL string `json:"url,omitempty" structs:"url,omitempty"` Title string `json:"title,omitempty" structs:"title,omitempty"` Summary string `json:"summary,omitempty" structs:"summary,omitempty"` Icon *RemoteLinkIcon `json:"icon,omitempty" structs:"icon,omitempty"` Status *RemoteLinkStatus `json:"status,omitempty" structs:"status,omitempty"` }
RemoteLinkObject represents remote link object itself
type RemoteLinkStatus ¶
type RemoteLinkStatus struct { Resolved bool `json:"resolved,omitempty" structs:"resolved,omitempty"` Icon *RemoteLinkIcon `json:"icon,omitempty" structs:"icon,omitempty"` }
RemoteLinkStatus if the link is a resolvable object (issue, epic) - the structure represent its status
type Request ¶
type Request struct { IssueID string `json:"issueId,omitempty" structs:"issueId,omitempty"` IssueKey string `json:"issueKey,omitempty" structs:"issueKey,omitempty"` TypeID string `json:"requestTypeId,omitempty" structs:"requestTypeId,omitempty"` ServiceDeskID string `json:"serviceDeskId,omitempty" structs:"serviceDeskId,omitempty"` Reporter *Customer `json:"reporter,omitempty" structs:"reporter,omitempty"` FieldValues []RequestFieldValue `json:"requestFieldValues,omitempty" structs:"requestFieldValues,omitempty"` Status *RequestStatus `json:"currentStatus,omitempty" structs:"currentStatus,omitempty"` Links *SelfLink `json:"_links,omitempty" structs:"_links,omitempty"` Expands []string `json:"_expands,omitempty" structs:"_expands,omitempty"` }
Request represents a ServiceDesk customer request.
type RequestComment ¶
type RequestComment struct { ID string `json:"id,omitempty" structs:"id,omitempty"` Body string `json:"body,omitempty" structs:"body,omitempty"` Public bool `json:"public" structs:"public"` Author *Customer `json:"author,omitempty" structs:"author,omitempty"` Created *RequestDate `json:"created,omitempty" structs:"created,omitempty"` Links *SelfLink `json:"_links,omitempty" structs:"_links,omitempty"` Expands []string `json:"_expands,omitempty" structs:"_expands,omitempty"` }
RequestComment is a comment for a request.
type RequestDate ¶
type RequestDate struct { ISO8601 string `json:"iso8601,omitempty" structs:"iso8601,omitempty"` Jira string `json:"jira,omitempty" structs:"jira,omitempty"` Friendly string `json:"friendly,omitempty" structs:"friendly,omitempty"` Epoch int64 `json:"epoch,omitempty" structs:"epoch,omitempty"` }
RequestDate is the date format used in requests.
type RequestFieldValue ¶
type RequestFieldValue struct { FieldID string `json:"fieldId,omitempty" structs:"fieldId,omitempty"` Label string `json:"label,omitempty" structs:"label,omitempty"` Value string `json:"value,omitempty" structs:"value,omitempty"` }
RequestFieldValue is a request field.
type RequestService ¶
type RequestService service
RequestService handles ServiceDesk customer requests for the Jira instance / API.
func (*RequestService) Create ¶
func (r *RequestService) Create(ctx context.Context, requester string, participants []string, request *Request) (*Request, *Response, error)
Create creates a new request.
func (*RequestService) CreateComment ¶
func (r *RequestService) CreateComment(ctx context.Context, issueIDOrKey string, comment *RequestComment) (*RequestComment, *Response, error)
CreateComment creates a comment on a request.
type RequestStatus ¶
type RequestStatus struct { Status string Category string Date RequestDate }
RequestStatus is the status for a request.
type Resolution ¶
type Resolution struct { Self string `json:"self" structs:"self"` ID string `json:"id" structs:"id"` Description string `json:"description" structs:"description"` Name string `json:"name" structs:"name"` }
Resolution represents a resolution of a Jira issue. Typical types are "Fixed", "Suspended", "Won't Fix", ...
type ResolutionService ¶
type ResolutionService service
ResolutionService handles resolutions for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Resolution
func (*ResolutionService) GetList ¶
func (s *ResolutionService) GetList(ctx context.Context) ([]Resolution, *Response, error)
GetList gets all resolutions from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-resolution-get
type Response ¶
Response represents Jira API response. It wraps http.Response returned from API and provides information about paging.
type Role ¶
type Role struct { Self string `json:"self" structs:"self"` Name string `json:"name" structs:"name"` ID int `json:"id" structs:"id"` Description string `json:"description" structs:"description"` Actors []*Actor `json:"actors" structs:"actors"` }
Role represents a Jira product role
type RoleService ¶
type RoleService service
RoleService handles roles for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Role
func (*RoleService) Get ¶
Get retreives a single Role from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-role-id-get
func (*RoleService) GetList ¶
GetList returns a list of all available project roles
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-role-get
type SearchOptions ¶
type SearchOptions struct { // StartAt: The starting index of the returned projects. Base index: 0. StartAt int `url:"startAt,omitempty"` // MaxResults: The maximum number of projects to return per page. Default: 50. MaxResults int `url:"maxResults,omitempty"` // Expand: Expand specific sections in the returned issues Expand string `url:"expand,omitempty"` Fields []string // ValidateQuery: The validateQuery param offers control over whether to validate and how strictly to treat the validation. Default: strict. ValidateQuery string `url:"validateQuery,omitempty"` }
SearchOptions specifies the optional parameters to various List methods that support pagination. Pagination is used for the Jira REST APIs to conserve server resources and limit response size for resources that return potentially large collection of items. A request to a pages API will result in a values array wrapped in a JSON object with some paging metadata Default Pagination options
type SelfLink ¶
type SelfLink struct {
Self string `json:"self,omitempty" structs:"self,omitempty"`
}
SelfLink Stores REST API URL to the organization.
type ServiceDeskOrganizationDTO ¶
type ServiceDeskOrganizationDTO struct {
OrganizationID int `json:"organizationId,omitempty" structs:"organizationId,omitempty"`
}
ServiceDeskOrganizationDTO is a DTO for ServiceDesk organizations
type ServiceDeskService ¶
type ServiceDeskService service
ServiceDeskService handles ServiceDesk for the Jira instance / API.
func (*ServiceDeskService) AddCustomers ¶
func (s *ServiceDeskService) AddCustomers(ctx context.Context, serviceDeskID interface{}, acountIDs ...string) (*Response, error)
AddCustomers adds customers to the given service desk.
func (*ServiceDeskService) AddOrganization ¶
func (s *ServiceDeskService) AddOrganization(ctx context.Context, serviceDeskID interface{}, organizationID int) (*Response, error)
AddOrganization adds an organization to a service desk. If the organization ID is already associated with the service desk, no change is made and the resource returns a 204 success code.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-post Caller must close resp.Body
func (*ServiceDeskService) GetOrganizations ¶
func (s *ServiceDeskService) GetOrganizations(ctx context.Context, serviceDeskID interface{}, start int, limit int, accountID string) (*PagedDTO, *Response, error)
GetOrganizations returns a list of all organizations associated with a service desk.
func (*ServiceDeskService) ListCustomers ¶
func (s *ServiceDeskService) ListCustomers(ctx context.Context, serviceDeskID interface{}, options *CustomerListOptions) (*CustomerList, *Response, error)
ListCustomers lists customers for a ServiceDesk.
func (*ServiceDeskService) RemoveCustomers ¶
func (s *ServiceDeskService) RemoveCustomers(ctx context.Context, serviceDeskID interface{}, acountIDs ...string) (*Response, error)
RemoveCustomers removes customers to the given service desk.
func (*ServiceDeskService) RemoveOrganization ¶
func (s *ServiceDeskService) RemoveOrganization(ctx context.Context, serviceDeskID interface{}, organizationID int) (*Response, error)
RemoveOrganization removes an organization from a service desk. If the organization ID does not match an organization associated with the service desk, no change is made and the resource returns a 204 success code.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-delete Caller must close resp.Body
type Session ¶
type Session struct { Self string `json:"self,omitempty"` Name string `json:"name,omitempty"` Session struct { Name string `json:"name"` Value string `json:"value"` } `json:"session,omitempty"` LoginInfo struct { FailedLoginCount int `json:"failedLoginCount"` LoginCount int `json:"loginCount"` LastFailedLoginTime string `json:"lastFailedLoginTime"` PreviousLoginTime string `json:"previousLoginTime"` } `json:"loginInfo"` Cookies []*http.Cookie }
Session represents a Session JSON response by the Jira API.
type Sprint ¶
type Sprint struct { ID int `json:"id" structs:"id"` Name string `json:"name" structs:"name"` CompleteDate *time.Time `json:"completeDate" structs:"completeDate"` EndDate *time.Time `json:"endDate" structs:"endDate"` StartDate *time.Time `json:"startDate" structs:"startDate"` OriginBoardID int `json:"originBoardId" structs:"originBoardId"` Self string `json:"self" structs:"self"` State string `json:"state" structs:"state"` }
Sprint represents a sprint on Jira agile board
type SprintService ¶
type SprintService service
SprintService handles sprints in Jira Agile API. See https://docs.atlassian.com/jira-software/REST/cloud/
func (*SprintService) GetIssue ¶
func (s *SprintService) GetIssue(ctx context.Context, issueID string, options *GetQueryOptions) (*Issue, *Response, error)
GetIssue returns a full representation of the issue for the given issue key. Jira will attempt to identify the issue by the issueIdOrKey path parameter. This can be an issue id, or an issue key. If the issue cannot be found via an exact match, Jira will also look for the issue in a case-insensitive way, or by looking to see if the issue was moved.
The given options will be appended to the query string ¶
Jira API docs: https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/issue-getIssue
TODO: create agile service for holding all agile apis' implementation
func (*SprintService) GetIssuesForSprint ¶
func (s *SprintService) GetIssuesForSprint(ctx context.Context, sprintID int) ([]Issue, *Response, error)
GetIssuesForSprint returns all issues in a sprint, for a given sprint Id. This only includes issues that the user has permission to view. By default, the returned issues are ordered by rank.
Jira API Docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/sprint-getIssuesForSprint
func (*SprintService) MoveIssuesToSprint ¶
func (s *SprintService) MoveIssuesToSprint(ctx context.Context, sprintID int, issueIDs []string) (*Response, error)
MoveIssuesToSprint moves issues to a sprint, for a given sprint Id. Issues can only be moved to open or active sprints. The maximum number of issues that can be moved in one operation is 50.
Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/sprint-moveIssuesToSprint Caller must close resp.Body
type SprintsList ¶
type SprintsList struct { MaxResults int `json:"maxResults" structs:"maxResults"` StartAt int `json:"startAt" structs:"startAt"` Total int `json:"total" structs:"total"` IsLast bool `json:"isLast" structs:"isLast"` Values []Sprint `json:"values" structs:"values"` }
SprintsList reflects a list of agile sprints
type Status ¶
type Status struct { Self string `json:"self" structs:"self"` Description string `json:"description" structs:"description"` IconURL string `json:"iconUrl" structs:"iconUrl"` Name string `json:"name" structs:"name"` ID string `json:"id" structs:"id"` StatusCategory StatusCategory `json:"statusCategory" structs:"statusCategory"` }
Status represents the current status of a Jira issue. Typical status are "Open", "In Progress", "Closed", ... Status can be user defined in every Jira instance.
type StatusCategory ¶
type StatusCategory struct { Self string `json:"self" structs:"self"` ID int `json:"id" structs:"id"` Name string `json:"name" structs:"name"` Key string `json:"key" structs:"key"` ColorName string `json:"colorName" structs:"colorName"` }
StatusCategory represents the category a status belongs to. Those categories can be user defined in every Jira instance.
type StatusCategoryService ¶
type StatusCategoryService service
StatusCategoryService handles status categories for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Statuscategory
func (*StatusCategoryService) GetList ¶
func (s *StatusCategoryService) GetList(ctx context.Context) ([]StatusCategory, *Response, error)
GetList gets all status categories from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-statuscategory-get
type StatusService ¶
type StatusService service
StatusService handles staties for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-group-Workflow-statuses
func (*StatusService) GetAllStatuses ¶
GetAllStatuses returns a list of all statuses associated with workflows.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-status-get
type Subtasks ¶
type Subtasks struct { ID string `json:"id" structs:"id"` Key string `json:"key" structs:"key"` Self string `json:"self" structs:"self"` Fields IssueFields `json:"fields" structs:"fields"` }
Subtasks represents all issues of a parent issue.
type Time ¶
Time represents the Time definition of Jira as a time.Time of go
func (Time) MarshalJSON ¶
MarshalJSON will transform the time.Time into a Jira time during the creation of a Jira request
func (*Time) UnmarshalJSON ¶
UnmarshalJSON will transform the Jira time into a time.Time during the transformation of the Jira JSON response
type TimeTracking ¶
type TimeTracking struct { OriginalEstimate string `json:"originalEstimate,omitempty" structs:"originalEstimate,omitempty"` RemainingEstimate string `json:"remainingEstimate,omitempty" structs:"remainingEstimate,omitempty"` TimeSpent string `json:"timeSpent,omitempty" structs:"timeSpent,omitempty"` OriginalEstimateSeconds int `json:"originalEstimateSeconds,omitempty" structs:"originalEstimateSeconds,omitempty"` RemainingEstimateSeconds int `json:"remainingEstimateSeconds,omitempty" structs:"remainingEstimateSeconds,omitempty"` TimeSpentSeconds int `json:"timeSpentSeconds,omitempty" structs:"timeSpentSeconds,omitempty"` }
TimeTracking represents the timetracking fields of a Jira issue.
type Transition ¶
type Transition struct { ID string `json:"id" structs:"id"` Name string `json:"name" structs:"name"` To Status `json:"to" structs:"status"` Fields map[string]TransitionField `json:"fields" structs:"fields"` }
Transition represents an issue transition in Jira
type TransitionField ¶
type TransitionField struct {
Required bool `json:"required" structs:"required"`
}
TransitionField represents the value of one Transition
type TransitionPayload ¶
type TransitionPayload struct {
ID string `json:"id" structs:"id"`
}
TransitionPayload represents the request payload of Transition calls like DoTransition
type TransitionPayloadComment ¶
type TransitionPayloadComment struct {
Add TransitionPayloadCommentBody `json:"add,omitempty" structs:"add,omitempty"`
}
TransitionPayloadComment represents comment in Transition payload
type TransitionPayloadCommentBody ¶
type TransitionPayloadCommentBody struct {
Body string `json:"body,omitempty"`
}
TransitionPayloadCommentBody represents body of comment in payload
type TransitionPayloadFields ¶
type TransitionPayloadFields struct {
Resolution *Resolution `json:"resolution,omitempty" structs:"resolution,omitempty"`
}
TransitionPayloadFields represents the fields that can be set when executing a transition
type TransitionPayloadUpdate ¶
type TransitionPayloadUpdate struct {
Comment []TransitionPayloadComment `json:"comment,omitempty" structs:"comment,omitempty"`
}
TransitionPayloadUpdate represents the updates of Transition calls like DoTransition
type UpdateQueryOptions ¶
type UpdateQueryOptions struct { NotifyUsers bool `url:"notifyUsers,omitempty"` OverrideScreenSecurity bool `url:"overrideScreenSecurity,omitempty"` OverrideEditableFlag bool `url:"overrideEditableFlag,omitempty"` }
UpdateQueryOptions specifies the optional parameters to the Edit issue
type User ¶
type User struct { Self string `json:"self,omitempty" structs:"self,omitempty"` AccountID string `json:"accountId,omitempty" structs:"accountId,omitempty"` AccountType string `json:"accountType,omitempty" structs:"accountType,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Key string `json:"key,omitempty" structs:"key,omitempty"` Password string `json:"-"` EmailAddress string `json:"emailAddress,omitempty" structs:"emailAddress,omitempty"` AvatarUrls AvatarUrls `json:"avatarUrls,omitempty" structs:"avatarUrls,omitempty"` DisplayName string `json:"displayName,omitempty" structs:"displayName,omitempty"` Active bool `json:"active,omitempty" structs:"active,omitempty"` TimeZone string `json:"timeZone,omitempty" structs:"timeZone,omitempty"` Locale string `json:"locale,omitempty" structs:"locale,omitempty"` ApplicationKeys []string `json:"applicationKeys,omitempty" structs:"applicationKeys,omitempty"` }
User represents a Jira user.
type UserGroup ¶
type UserGroup struct { Self string `json:"self,omitempty" structs:"self,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` }
UserGroup represents the group list
type UserService ¶
type UserService service
UserService handles users for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-group-Users
func (*UserService) Create ¶
Create creates an user in Jira.
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/user-createUser
func (*UserService) Delete ¶
Delete deletes an user from Jira. Returns http.StatusNoContent on success.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-user-delete Caller must close resp.Body
func (*UserService) Find ¶
func (s *UserService) Find(ctx context.Context, property string, tweaks ...userSearchF) ([]User, *Response, error)
Find searches for user info from Jira: It can find users by email or display name using the query parameter
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-user-search-get
func (*UserService) Get ¶
Get gets user info from Jira using its Account Id
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-user-get
func (*UserService) GetByAccountID ¶
func (s *UserService) GetByAccountID(ctx context.Context, accountID string) (*User, *Response, error)
GetByAccountID gets user info from Jira Searching by another parameter that is not accountId is deprecated, but this method is kept for backwards compatibility Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/user-getUser
func (*UserService) GetGroups ¶
func (s *UserService) GetGroups(ctx context.Context, accountId string) (*[]UserGroup, *Response, error)
GetGroups returns the groups which the user belongs to
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-user-groups-get
func (*UserService) GetSelf ¶
GetSelf information about the current logged-in user
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-myself-get
type Version ¶
type Version struct { Self string `json:"self,omitempty" structs:"self,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` Description string `json:"description,omitempty" structs:"description,omitempty"` Archived *bool `json:"archived,omitempty" structs:"archived,omitempty"` Released *bool `json:"released,omitempty" structs:"released,omitempty"` ReleaseDate string `json:"releaseDate,omitempty" structs:"releaseDate,omitempty"` UserReleaseDate string `json:"userReleaseDate,omitempty" structs:"userReleaseDate,omitempty"` ProjectID int `json:"projectId,omitempty" structs:"projectId,omitempty"` // Unlike other IDs, this is returned as a number StartDate string `json:"startDate,omitempty" structs:"startDate,omitempty"` }
Version represents a single release version of a project
type VersionService ¶
type VersionService service
VersionService handles Versions for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/version
func (*VersionService) Create ¶
Create creates a version in Jira.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-version-post
func (*VersionService) Get ¶
Get gets version info from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-version-id-get
func (*VersionService) Update ¶
Update updates a version from a JSON representation.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-version-id-put Caller must close resp.Body
type Watcher ¶
type Watcher struct { Self string `json:"self,omitempty" structs:"self,omitempty"` Name string `json:"name,omitempty" structs:"name,omitempty"` AccountID string `json:"accountId,omitempty" structs:"accountId,omitempty"` DisplayName string `json:"displayName,omitempty" structs:"displayName,omitempty"` Active bool `json:"active,omitempty" structs:"active,omitempty"` }
Watcher represents a simplified user that "observes" the issue
type Watches ¶
type Watches struct { Self string `json:"self,omitempty" structs:"self,omitempty"` WatchCount int `json:"watchCount,omitempty" structs:"watchCount,omitempty"` IsWatching bool `json:"isWatching,omitempty" structs:"isWatching,omitempty"` Watchers []*Watcher `json:"watchers,omitempty" structs:"watchers,omitempty"` }
Watches represents a type of how many and which user are "observing" a Jira issue to track the status / updates.
type Worklog ¶
type Worklog struct { StartAt int `json:"startAt" structs:"startAt"` MaxResults int `json:"maxResults" structs:"maxResults"` Total int `json:"total" structs:"total"` Worklogs []WorklogRecord `json:"worklogs" structs:"worklogs"` }
Worklog represents the work log of a Jira issue. One Worklog contains zero or n WorklogRecords Jira Wiki: https://confluence.atlassian.com/jira/logging-work-on-an-issue-185729605.html
type WorklogRecord ¶
type WorklogRecord struct { Self string `json:"self,omitempty" structs:"self,omitempty"` Author *User `json:"author,omitempty" structs:"author,omitempty"` UpdateAuthor *User `json:"updateAuthor,omitempty" structs:"updateAuthor,omitempty"` Comment string `json:"comment,omitempty" structs:"comment,omitempty"` Created *Time `json:"created,omitempty" structs:"created,omitempty"` Updated *Time `json:"updated,omitempty" structs:"updated,omitempty"` Started *Time `json:"started,omitempty" structs:"started,omitempty"` TimeSpent string `json:"timeSpent,omitempty" structs:"timeSpent,omitempty"` TimeSpentSeconds int `json:"timeSpentSeconds,omitempty" structs:"timeSpentSeconds,omitempty"` ID string `json:"id,omitempty" structs:"id,omitempty"` IssueID string `json:"issueId,omitempty" structs:"issueId,omitempty"` Properties []EntityProperty `json:"properties,omitempty"` }
WorklogRecord represents one entry of a Worklog
Source Files ¶
- auth_transport.go
- auth_transport_basic.go
- auth_transport_bearer.go
- auth_transport_cookie.go
- auth_transport_jwt.go
- auth_transport_personal_access_token.go
- authentication.go
- board.go
- component.go
- customer.go
- error.go
- field.go
- filter.go
- group.go
- issue.go
- issuelinktype.go
- jira.go
- metaissue.go
- organization.go
- permissionscheme.go
- priority.go
- project.go
- request.go
- resolution.go
- role.go
- servicedesk.go
- sprint.go
- status.go
- statuscategory.go
- types.go
- user.go
- version.go