Skip to main content

API Base

This category contains all the functions to directly access the Jira API. You can find all the api description at the official documentation page.

The responses are cached in order to reduce the network load. You can clean the cache using dedicated api or the command.

getIssue

  • $ji.base.getIssue(issueKey: string, options: { fields?: string[], account?: IJiraIssueAccountSettings } = {})

Retrieve all details related to an issue based on the key. Use the parameter options.fields to specify the list of fields you need, in order to reduce the Jira and network load.

ParameterRequiredTypeDefault valueDescription
issueKeyTruestring-Id or Key of the issue to retrieve
options.fieldsFalsestring[]Most of the fieldsList of fields to retrieve
options.accountFalseIJiraIssueAccountSettingsAutomatically detectJira account to use. Use the util api to retrieve an account object.

Return value type: Promise<IJiraIssue>

getSearchResults

  • $ji.base.getSearchResults(query: string, options: { limit?: number, offset?: number, fields?: string[], account?: IJiraIssueAccountSettings } = {})

Execute a JQL query to get all the matching issues.

ParameterRequiredTypeDefault valueDescription
queryTruestring-JQL query to find the issues
options.limitFalsenumber > 0Configured in SettingsMaximum number of issue to extract
options.fieldsFalsestring[]Most of the fieldsList of fields to retrieve
options.accountFalseIJiraIssueAccountSettingsAutomatically detectJira account to use. Use the util api to retrieve an account object.

Return value type: Promise<IJiraSearchResults>

getDevStatus

  • $ji.base.getDevStatus(issueId: string, options: { account?: IJiraIssueAccountSettings } = {})

Retrieve the pull requests open/merged/declined related to a user story.

This API works only if the version control software has been connected to your Jira account using OAuth2. To check your the list of Authorized Application go to Profile > Tools > View OAuth Access Tokens.

ParameterRequiredTypeDefault valueDescription
issueIdTruestring-Issue ID. The id can be found using the getIssue API.
options.accountFalseIJiraIssueAccountSettingsAutomatically detectJira account to use. Use the util api to retrieve an account object.

Return value type: Promise<IJiraDevStatus>

getBoards

  • $ji.base.getBoards(projectKeyOrId: string, options: { limit?: number, offset?: number, account?: IJiraIssueAccountSettings } = {})

Retrieve list of boards associated to a project.

ParameterRequiredTypeDefault valueDescription
projectKeyOrIdTruestring-Project key or numeric id
options.limitFalsenumber > 0Configured in SettingsMaximum number of boards to extract
options.accountFalseIJiraIssueAccountSettingsAutomatically detectJira account to use. Use the util api to retrieve an account object.

Return value type: Promise<IJiraBoard[]>

getSprints

  • $ji.base.getSprints(boardId: number, options: { limit?: number, offset?: number, state?: ESprintState[], account?: IJiraIssueAccountSettings } = {})

Retrieve list of sprints associated to a board.

ParameterRequiredTypeDefault valueDescription
boardIdTruenumber-Board numeric id
options.limitFalsenumber > 0Configured in SettingsMaximum number of sprints to extract
options.accountFalseIJiraIssueAccountSettingsAutomatically detectJira account to use. Use the util api to retrieve an account object.

Return value type: Promise<IJiraSprint[]>

getLoggedUser

  • $ji.base.getLoggedUser(account: IJiraIssueAccountSettings = null)

Retrieve information related to the user associated to the credentials configured in the plugin settings.

ParameterRequiredTypeDefault valueDescription
accountTrueIJiraIssueAccountSettings-Jira account to use. Use the util api to retrieve an account object.

Return value type: Promise<IJiraUser>