AuthenticationService handles authentication for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#authentication
Authentication type
client*Client
Basic auth password
Basic auth username
AcquireSessionCookie wraps AcquireSessionCookieWithContext using the background context.
Deprecated: Use CookieAuthTransport instead
AcquireSessionCookieWithContext 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
Authenticated reports if the current Client has authentication details for Jira
GetCurrentUser wraps GetCurrentUserWithContext using the background context.
GetCurrentUserWithContext gets the details of the current user.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
Logout wraps LogoutWithContext using the background context.
Deprecated: Use CookieAuthTransport to create base client. Logging out is as simple as not using the
client anymore
LogoutWithContext 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
SetBasicAuth sets username and password for the basic auth against the Jira instance.
Deprecated: Use BasicAuthTransport instead
BasicAuthTransport is an http.RoundTripper that authenticates all requests
using HTTP Basic Authentication with the provided username and password.
Passwordstring
Transport is the underlying HTTP transport to use when making requests.
It will default to http.DefaultTransport if nil.
Usernamestring
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.
RoundTrip implements the RoundTripper interface. We just add the
basic auth and return the RoundTripper for this transport type.
(*T) transport() http.RoundTripper
*T : net/http.RoundTripper
BoardConfigurationColumnConfig lists the columns for a given board in the order defined in the column configuration
with constrainttype (none, issueCount, issueCountExclSubs)
Columns[]BoardConfigurationColumnConstraintTypestring
BoardConfigurationColumnStatus represents a status in the column configuration
IDstringSelfstring
BoardConfigurationFilter reference to the filter used by the given board.
IDstringSelfstring
BoardConfigurationSubQuery (Kanban only) - JQL subquery used by the given board.
Querystring
BoardListOptions specifies the optional parameters to the BoardService.GetList
BoardType filters results to boards of the specified type.
Valid values: scrum, kanban.
Name filters results to boards that match or partially match the specified name.
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.
SearchOptionsSearchOptions
Expand: Expand specific sections in the returned issues
SearchOptions.Fields[]string
MaxResults: The maximum number of projects to return per page. Default: 50.
StartAt: The starting index of the returned projects. Base index: 0.
ValidateQuery: The validateQuery param offers control over whether to validate and how strictly to treat the validation. Default: strict.
func (*BoardService).GetAllBoards(opt *BoardListOptions) (*BoardsList, *Response, error)
func (*BoardService).GetAllBoardsWithContext(ctx context.Context, opt *BoardListOptions) (*BoardsList, *Response, error)
BoardService handles Agile Boards for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira-software/REST/server/
client*Client
CreateBoard wraps CreateBoardWithContext using the background context.
CreateBoardWithContext 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
DeleteBoard wraps DeleteBoardWithContext using the background context.
DeleteBoardWithContext will delete an agile board.
Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-deleteBoard
GetAllBoards wraps GetAllBoardsWithContext using the background context.
GetAllBoardsWithContext 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
GetAllSprints wraps GetAllSprintsWithContext using the background context.
GetAllSprintsWithContext will return 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://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint
GetAllSprintsWithOptions wraps GetAllSprintsWithOptionsWithContext using the background context.
GetAllSprintsWithOptionsWithContext will return sprints from a board, for a given board Id and filtering options
This only includes sprints that the user has permission to view.
Jira API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/sprint
GetBoard wraps GetBoardWithContext using the background context.
GetBoardConfiguration wraps GetBoardConfigurationWithContext using the background context.
GetBoardConfigurationWithContext 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
GetBoardWithContext 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
A Client manages communication with the Jira API.
Services used for talking to different parts of the Jira API.
Board*BoardServiceComponent*ComponentServiceField*FieldServiceFilter*FilterServiceGroup*GroupServiceIssue*IssueServiceIssueLinkType*IssueLinkTypeServiceOrganization*OrganizationServicePermissionScheme*PermissionSchemeServicePriority*PriorityServiceProject*ProjectServiceResolution*ResolutionServiceRole*RoleServiceServiceDesk*ServiceDeskServiceSprint*SprintServiceStatus*StatusServiceStatusCategory*StatusCategoryServiceUser*UserServiceVersion*VersionService
Base URL for API requests.
HTTP client used to communicate with the API.
Session storage if the user authenticates with a Session cookie
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.
GetBaseURL will return you the Base URL.
This is the same URL as in the NewClient constructor
NewMultiPartRequest wraps NewMultiPartRequestWithContext using the background context.
NewMultiPartRequestWithContext 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.
NewRawRequest wraps NewRawRequestWithContext using the background context.
NewRawRequestWithContext 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.
NewRequest wraps NewRequestWithContext using the background context.
NewRequestWithContext 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.
func NewClient(httpClient httpClient, baseURL string) (*Client, error)
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
client*Client
Create wraps CreateWithContext using the background context.
CreateWithContext creates a new Jira component based on the given options.
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
AuthURLstringPasswordstring
SessionObject is the authenticated cookie string.s
It's passed in each call to prove the client is authenticated.
Transport is the underlying HTTP transport to use when making requests.
It will default to http.DefaultTransport if nil.
Usernamestring
Client returns an *http.Client that makes requests that are authenticated
using cookie authentication
RoundTrip adds the session object to the request.
getAuthRequest assembles the request to get the authenticated cookie
setSessionObject attempts to authenticate the user and set
the session object (e.g. cookie)
(*T) transport() http.RoundTripper
*T : net/http.RoundTripper
Date represents the Date definition of Jira as a time.Time of go
extint64
loc specifies the Location that should be used to
determine the minute, hour, month, day, and year
that correspond to this Time.
The nil location means UTC.
All UTC times are represented with loc==nil, never loc==&utcLoc.
wall and ext encode the wall time seconds, wall time nanoseconds,
and optional monotonic clock reading in nanoseconds.
From high to low bit position, wall encodes a 1-bit flag (hasMonotonic),
a 33-bit seconds field, and a 30-bit wall time nanoseconds field.
The nanoseconds field is in the range [0, 999999999].
If the hasMonotonic bit is 0, then the 33-bit field must be zero
and the full signed 64-bit wall seconds since Jan 1 year 1 is stored in ext.
If the hasMonotonic bit is 1, then the 33-bit field holds a 33-bit
unsigned wall seconds since Jan 1 year 1885, and ext holds a
signed 64-bit monotonic clock reading, nanoseconds since process start.
MarshalJSON will transform the Date object into a short
date string as Jira expects during the creation of a
Jira request
UnmarshalJSON will transform the Jira date into a time.Time
during the transformation of the Jira JSON response
T : encoding/json.Marshaler
*T : encoding/json.Unmarshaler
Error message from Jira
See https://docs.atlassian.com/jira/REST/cloud/#error-responses
ErrorMessages[]stringErrorsmap[string]stringHTTPErrorerror
Error is a short string representing the error
LongError is a full representation of the error as a string
*T : error
FieldService handles fields for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Field
client*Client
GetList wraps GetListWithContext using the background context.
GetListWithContext gets all fields from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-field-get
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
User account ID used to return filters with the matching owner.accountId. This parameter cannot be used with owner.
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.
String used to perform a case-insensitive partial match with name.
Group name used to returns filters that are shared with a group that matches sharePermissions.group.groupname.
The maximum number of items to return per page. The maximum is 100.
Default: 50, Format: int32
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
Project ID used to returns filters that are shared with a project that matches sharePermissions.project.id.
Format: int64
The index of the first item to return in a page of results (page offset).
Default: 0, Format: int64
func (*FilterService).Search(opt *FilterSearchOptions) (*FiltersList, *Response, error)
func (*FilterService).SearchWithContext(ctx context.Context, opt *FilterSearchOptions) (*FiltersList, *Response, error)
FilterService handles fields for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Filter
client*Client
Get wraps GetWithContext using the background context.
GetFavouriteList wraps GetFavouriteListWithContext using the background context.
GetFavouriteListWithContext retrieves the user's favourited filters from Jira
GetList wraps GetListWithContext using the background context.
GetListWithContext retrieves all filters from Jira
GetMyFilters wraps GetMyFiltersWithContext using the background context.
GetMyFiltersWithContext retrieves the my Filters.
https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-filter-my-get
GetWithContext retrieves a single Filter from Jira
Search wraps SearchWithContext using the background context.
SearchWithContext 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
GetAllSprintsOptions specifies the optional parameters to the BoardService.GetList
SearchOptionsSearchOptions
Expand: Expand specific sections in the returned issues
SearchOptions.Fields[]string
MaxResults: The maximum number of projects to return per page. Default: 50.
StartAt: The starting index of the returned projects. Base index: 0.
ValidateQuery: The validateQuery param offers control over whether to validate and how strictly to treat the validation. Default: strict.
State filters results to sprints in the specified states, comma-separate list
func (*BoardService).GetAllSprintsWithOptions(boardID int, options *GetAllSprintsOptions) (*SprintsList, *Response, error)
func (*BoardService).GetAllSprintsWithOptionsWithContext(ctx context.Context, boardID int, options *GetAllSprintsOptions) (*SprintsList, *Response, error)
GroupService handles Groups for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/server/#api/2/group
client*Client
Add wraps AddWithContext using the background context.
AddWithContext adds user to group
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/group-addUserToGroup
Get wraps GetWithContext using the background context.
GetWithContext returns a paginated list of users who are 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
GetWithOptions wraps GetWithOptionsWithContext using the background context.
GetWithOptionsWithContext 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
Remove wraps RemoveWithContext using the background context.
RemoveWithContext removes user from group
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/group-removeUserFromGroup
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
client*Client
Create wraps CreateWithContext using the background context.
CreateWithContext 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
Delete wraps DeleteWithContext using the background context.
DeleteWithContext 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
Get wraps GetWithContext using the background context.
GetList wraps GetListWithContext using the background context.
GetListWithContext 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
GetWithContext 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
Update wraps UpdateWithContext using the background context.
UpdateWithContext 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
IssueRenderedFields represents rendered fields of a Jira issue.
Not all IssueFields are rendered.
Comments*CommentsCreatedstringDescriptionstringDuedatestring
TODO Missing fields
* "aggregatetimespent": null,
* "workratio": -1,
* "lastViewed": null,
* "aggregatetimeoriginalestimate": null,
* "aggregatetimeestimate": null,
* "environment": null,
Updatedstring
IssueService handles Issues for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue
client*Client
AddComment wraps AddCommentWithContext using the background context.
AddCommentWithContext adds a new comment to issueID.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-addComment
AddLink wraps AddLinkWithContext using the background context.
AddLinkWithContext adds a link between two issues.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issueLink
AddRemoteLink wraps AddRemoteLinkWithContext using the background context.
AddRemoteLinkWithContext 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
AddWatcher wraps AddWatcherWithContext using the background context.
AddWatcherWithContext adds watcher to the given issue
Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-addWatcher
AddWorklogRecord wraps AddWorklogRecordWithContext using the background context.
AddWorklogRecordWithContext adds a new worklog record to issueID.
https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-issueIdOrKey-worklog-post
Create wraps CreateWithContext using the background context.
CreateWithContext 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
Delete wraps DeleteWithContext using the background context.
DeleteAttachment wraps DeleteAttachmentWithContext using the background context.
DeleteAttachmentWithContext deletes an attachment of a given attachmentID
DeleteComment wraps DeleteCommentWithContext using the background context.
DeleteCommentWithContext 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
DeleteLink wraps DeleteLinkWithContext using the background context.
DeleteLinkWithContext deletes a link of a given linkID
DeleteWithContext will delete a specified issue.
DoTransition wraps DoTransitionWithContext using the background context.
DoTransitionWithContext 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
DoTransitionWithPayload wraps DoTransitionWithPayloadWithContext using the background context.
DoTransitionWithPayloadWithContext 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
DownloadAttachment wraps DownloadAttachmentWithContext using the background context.
DownloadAttachmentWithContext 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.
The caller should close the resp.Body.
Get wraps GetWithContext using the background context.
GetCreateMeta wraps GetCreateMetaWithContext using the background context.
GetCreateMetaWithContext makes the api call to get the meta information required to create a ticket
GetCreateMetaWithOptions wraps GetCreateMetaWithOptionsWithContext using the background context.
GetCreateMetaWithOptionsWithContext makes the api call to get the meta information without requiring to have a projectKey
GetCustomFields wraps GetCustomFieldsWithContext using the background context.
GetCustomFieldsWithContext returns a map of customfield_* keys with string values
GetEditMeta wraps GetEditMetaWithContext using the background context.
GetEditMetaWithContext makes the api call to get the edit meta information for an issue
GetRemoteLinks wraps GetRemoteLinksWithContext using the background context.
GetRemoteLinksWithContext gets remote issue links on the issue.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/issue-getRemoteIssueLinks
GetTransitions wraps GetTransitionsWithContext using the background context.
GetTransitionsWithContext 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
GetWatchers wraps GetWatchersWithContext using the background context.
GetWatchersWithContext 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
GetWithContext 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
GetWorklogs wraps GetWorklogsWithContext using the background context.
GetWorklogsWithContext 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
PostAttachment wraps PostAttachmentWithContext using the background context.
PostAttachmentWithContext uploads r (io.Reader) as an attachment to a given issueID
RemoveWatcher wraps RemoveWatcherWithContext using the background context.
RemoveWatcherWithContext removes given user from given issue
Jira API docs: https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-removeWatcher
Search wraps SearchWithContext using the background context.
SearchPages wraps SearchPagesWithContext using the background context.
SearchPagesWithContext 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
SearchWithContext 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
Update wraps UpdateWithContext using the background context.
UpdateAssignee wraps UpdateAssigneeWithContext using the background context.
UpdateAssigneeWithContext 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
UpdateComment wraps UpdateCommentWithContext using the background context.
UpdateCommentWithContext 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
UpdateIssue wraps UpdateIssueWithContext using the background context.
UpdateIssueWithContext 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
UpdateWithContext updates an issue from a JSON representation. The issue is found by key.
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-editIssue
UpdateWithOptions wraps UpdateWithOptionsWithContext using the background context.
UpdateWithOptionsWithContext updates an issue from a JSON representation,
while also specifying query params. The issue is found by key.
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-editIssue
UpdateWorklogRecord wraps UpdateWorklogRecordWithContext using the background context.
UpdateWorklogRecordWithContext updates a worklog record.
https://docs.atlassian.com/software/jira/docs/api/REST/7.1.2/#api/2/issue-updateWorklog
IssuesInSprintResult represents a wrapper struct for search result
Issues[]Issue
IssuesWrapper represents a wrapper struct for moving issues to sprint
Issues[]string
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
IssuerstringSecret[]byte
Transport is the underlying HTTP transport to use when making requests.
It will default to http.DefaultTransport if nil.
(*T) Client() *http.Client
RoundTrip adds the session object to the request.
(*T) canonicalizeRequest(httpMethod string, jiraURL *url.URL) string(*T) createQueryStringHash(httpMethod string, jiraURL *url.URL) string(*T) transport() http.RoundTripper
*T : net/http.RoundTripper
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.
DescriptionstringExpandstringFieldstcontainer.MarshalMapIconUrlstringIdstringNamestringSelfstringSubtasksbool
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.
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.
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.
func (*MetaProject).GetIssueTypeWithName(name string) *MetaIssueType
func InitIssueWithMetaAndFields(metaProject *MetaProject, metaIssuetype *MetaIssueType, fieldsConfig map[string]string) (*Issue, error)
OrganizationCreationDTO is DTO for creat organization API
Namestring
OrganizationService handles Organizations for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/
client*Client
AddUsers wraps AddUsersWithContext using the background context.
AddUsersWithContext adds users to an organization.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-user-post
CreateOrganization wraps CreateOrganizationWithContext using the background context.
CreateOrganizationWithContext 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
DeleteOrganization wraps DeleteOrganizationWithContext using the background context.
DeleteOrganizationWithContext 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
DeleteProperty wraps DeletePropertyWithContext using the background context.
DeletePropertyWithContext 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
GetAllOrganizations wraps GetAllOrganizationsWithContext using the background context.
GetAllOrganizationsWithContext 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
GetOrganization wraps GetOrganizationWithContext using the background context.
GetOrganizationWithContext 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.
Jira API docs: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-get
GetPropertiesKeys wraps GetPropertiesKeysWithContext using the background context.
GetPropertiesKeysWithContext 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.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-property-get
GetProperty wraps GetPropertyWithContext using the background context.
GetPropertyWithContext returns the value of a property
from an organization. Use this method to obtain the JSON
content for an organization's property.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-property-propertykey-get
GetUsers wraps GetUsersWithContext using the background context.
GetUsersWithContext 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.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-user-get
RemoveUsers wraps RemoveUsersWithContext using the background context.
RemoveUsersWithContext removes users from an organization.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-user-delete
SetProperty wraps SetPropertyWithContext using the background context.
SetPropertyWithContext 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
PermissionSchemeService handles permissionschemes for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Permissionscheme
client*Client
Get wraps GetWithContext using the background context.
GetList wraps GetListWithContext using the background context.
GetListWithContext returns a list of all permission schemes
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-permissionscheme-get
GetWithContext 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
PriorityService handles priorities for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Priority
client*Client
GetList wraps GetListWithContext using the background context.
GetListWithContext gets all priorities from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-priority-get
ProjectService handles projects for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project
client*Client
Get wraps GetWithContext using the background context.
GetList wraps GetListWithContext using the background context.
GetListWithContext gets all projects form Jira
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project-getAllProjects
GetPermissionScheme wraps GetPermissionSchemeWithContext using the background context.
GetPermissionSchemeWithContext 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
GetWithContext 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
ListWithOptions wraps ListWithOptionsWithContext using the background context.
ListWithOptionsWithContext gets 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://docs.atlassian.com/jira/REST/latest/#api/2/project-getAllProjects
ResolutionService handles resolutions for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Resolution
client*Client
GetList wraps GetListWithContext using the background context.
GetListWithContext gets all resolutions from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-resolution-get
RoleService handles roles for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Role
client*Client
Get wraps GetWithContext using the background context.
GetList wraps GetListWithContext using the background context.
GetListWithContext 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
GetWithContext retreives a single Role from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-role-id-get
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
Expand: Expand specific sections in the returned issues
Fields[]string
MaxResults: The maximum number of projects to return per page. Default: 50.
StartAt: The starting index of the returned projects. Base index: 0.
ValidateQuery: The validateQuery param offers control over whether to validate and how strictly to treat the validation. Default: strict.
func gitlab.com/pcanilho/go-jira-cli/cmd.composeSearchOptions() *SearchOptions
func (*IssueService).Search(jql string, options *SearchOptions) ([]Issue, *Response, error)
func (*IssueService).SearchPages(jql string, options *SearchOptions, f func(Issue) error) error
func (*IssueService).SearchPagesWithContext(ctx context.Context, jql string, options *SearchOptions, f func(Issue) error) error
func (*IssueService).SearchWithContext(ctx context.Context, jql string, options *SearchOptions) ([]Issue, *Response, error)
func gitlab.com/pcanilho/go-jira-cli/internal.Controller.SearchIssues(string, *SearchOptions, int) ([]Issue, error)
func gitlab.com/pcanilho/go-jira-cli/internal.IssueController.SearchIssues(string, *SearchOptions, int) ([]Issue, error)
SelfLink Stores REST API URL to the organization.
Selfstring
ServiceDeskOrganizationDTO is a DTO for ServiceDesk organizations
OrganizationIDint
ServiceDeskService handles ServiceDesk for the Jira instance / API.
client*Client
AddOrganization wraps AddOrganizationWithContext using the background context.
AddOrganizationWithContext 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
GetOrganizations wraps GetOrganizationsWithContext using the background context.
GetOrganizationsWithContext returns a list of
all organizations associated with a service desk.
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-get
RemoveOrganization wraps RemoveOrganizationWithContext using the background context.
RemoveOrganizationWithContext 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
SprintService handles sprints in Jira Agile API.
See https://docs.atlassian.com/jira-software/REST/cloud/
client*Client
GetIssue wraps GetIssueWithContext using the background context.
GetIssueWithContext 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
GetIssuesForSprint wraps GetIssuesForSprintWithContext using the background context.
GetIssuesForSprintWithContext 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
MoveIssuesToSprint wraps MoveIssuesToSprintWithContext using the background context.
MoveIssuesToSprintWithContext 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
StatusCategoryService handles status categories for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-Statuscategory
client*Client
GetList wraps GetListWithContext using the background context.
GetListWithContext gets all status categories from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-statuscategory-get
StatusService handles staties for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-group-Workflow-statuses
client*Client
GetAllStatuses wraps GetAllStatusesWithContext using the background context.
GetAllStatusesWithContext 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
Time represents the Time definition of Jira as a time.Time of go
extint64
loc specifies the Location that should be used to
determine the minute, hour, month, day, and year
that correspond to this Time.
The nil location means UTC.
All UTC times are represented with loc==nil, never loc==&utcLoc.
wall and ext encode the wall time seconds, wall time nanoseconds,
and optional monotonic clock reading in nanoseconds.
From high to low bit position, wall encodes a 1-bit flag (hasMonotonic),
a 33-bit seconds field, and a 30-bit wall time nanoseconds field.
The nanoseconds field is in the range [0, 999999999].
If the hasMonotonic bit is 0, then the 33-bit field must be zero
and the full signed 64-bit wall seconds since Jan 1 year 1 is stored in ext.
If the hasMonotonic bit is 1, then the 33-bit field holds a 33-bit
unsigned wall seconds since Jan 1 year 1885, and ext holds a
signed 64-bit monotonic clock reading, nanoseconds since process start.
( T) Equal(u Time) bool
MarshalJSON will transform the time.Time into a Jira time
during the creation of a Jira request
UnmarshalJSON will transform the Jira time into a time.Time
during the transformation of the Jira JSON response
T : encoding/json.Marshaler
*T : encoding/json.Unmarshaler
func Time.Equal(u Time) bool
UserService handles users for the Jira instance / API.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-group-Users
client*Client
Create wraps CreateWithContext using the background context.
CreateWithContext creates an user in Jira.
Jira API docs: https://docs.atlassian.com/jira/REST/cloud/#api/2/user-createUser
Delete wraps DeleteWithContext using the background context.
DeleteWithContext 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
Find wraps FindWithContext using the background context.
FindWithContext 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
Get wraps GetWithContext using the background context.
GetByAccountID wraps GetByAccountIDWithContext using the background context.
GetByAccountIDWithContext 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
GetGroups wraps GetGroupsWithContext using the background context.
GetGroupsWithContext 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
GetSelf wraps GetSelfWithContext using the background context.
GetSelfWithContext 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
GetWithContext 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
VersionService handles Versions for the Jira instance / API.
Jira API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/version
client*Client
Create wraps CreateWithContext using the background context.
CreateWithContext creates a version in Jira.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-version-post
Get wraps GetWithContext using the background context.
GetWithContext gets version info from Jira
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-version-id-get
Update wraps UpdateWithContext using the background context.
UpdateWithContext updates a version from a JSON representation.
Jira API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-version-id-put
httpClient defines an interface for an http.Client implementation so that alternative
http Clients can be passed in for making requests
( T) Do(request *http.Request) (response *http.Response, err error)
*net/http.Client
func NewClient(httpClient httpClient, baseURL string) (*Client, error)
Package-Level Functions (total 14, in which 10 are exported)
Bool is a helper routine that allocates a new bool value
to store v and returns a pointer to it.
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).
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.
NewClient returns a new Jira API client.
If a nil httpClient is provided, http.DefaultClient will be used.
To use API methods which require authentication you can follow the preferred solution and
provide an http.Client that will perform the authentication for you with OAuth and HTTP Basic (such as that provided by the golang.org/x/oauth2 library).
As an alternative you can use Session Cookie based authentication provided by this package as well.
See https://docs.atlassian.com/jira/REST/latest/#authentication
baseURL is the HTTP endpoint of your Jira instance and should always be specified with a trailing slash.
NewJiraError creates a new jira Error
WithActive sets the active users lookup
WithInactive sets the inactive users lookup
WithMaxResults sets the max results to return
Applies query options to http request.
This helper is meant to be used with all "QueryOptions" structs.
WithStartAt set the start pager
addOptions adds the parameters in opt as URL query parameters to s. opt
must be a struct whose fields may contain "url" tags.
cloneRequest returns a clone of the provided *http.Request.
The clone is a shallow copy of the struct and its Header map.
Package-Level Constants (total 7, in which 5 are exported)
AssigneeAutomatic represents the value of the "Assignee: Automatic" of Jira
These constants are the keys of the default Jira status categories
These constants are the keys of the default Jira status categories
These constants are the keys of the default Jira status categories
These constants are the keys of the default Jira status categories
HTTP Basic Authentication
HTTP Session Authentication
The pages are generated with Goldsv0.3.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.