Home Reference Source Repository
import JiraApi from 'jira-client/src/jira.js'
public class | source

JiraApi

Constructor Summary

Public Constructor
public

constructor(options: *)

Member Summary

Public Members
public
public

base: *

public

host: *

public
public

port: *

public
public

request: *

public
public

Method Summary

Public Methods
public

addAttachmentOnIssue(issueId: string, readStream: object): *

Add attachment to a Issue

public

addComment(issueId: string, comment: string): *

Add a comment to an issue Jira Doc

public

addIssueToSprint(issueId: string, sprintId: string): *

Add an issue to the project's current sprint

public

addNewComponent(component: object): *

Add component to Jira Jira Doc

public

addNewIssue(issue: object): *

Add issue to Jira Jira Doc

public

addWatcher(issueKey: string, username: string): *

Add a user as a watcher on an issue

public

addWorklog(issueId: string, worklog: object, newEstimate: object): *

Add a worklog to a project Jira Doc

public

createRemoteLink(issueNumber: string, remoteLink: object): *

public

createVersion(version: string): *

Create a version Jira Doc

public

deleteComponent(componentId: string): *

Delete component from Jira Jira Doc

public

deleteIssue(issueId: string): *

Delete issue from Jira Jira Doc

public

deleteWebhook(webhookID: string): *

Delete a registered webhook Jira Doc

public

deleteWorklog(issueId: string, worklogId: string): *

Delete worklog from issue Jira Doc

public

doRequest(requestOptions: object): *

public

findIssue(issueNumber: string): *

public

findRapidView(projectName: string): *

Find the Rapid View for a specified project

public

getBacklogForRapidView(rapidViewId: string): *

Retrieve the backlog of a certain Rapid View

public

Describe the currently authenticated user Jira Doc

public

Get a list of Sprints belonging to a Rapid View

public

getProject(project: string): *

public

getRemoteLinks(issueNumber: string): *

Retrieves the remote links associated with the given issue.

public

getSprintIssues(rapidViewId: string, sprintId: string): *

Get the issues for a rapidView / sprint

public
public

getUsersInGroup(groupName: string, startAt: integer, maxResults: integer): *

Get all users in group on Jira

public

getUsersIssues(username: string, open: boolean): *

Get issues related to a user Jira Doc

public

getVersions(project: string): *

Get Versions for a project Jira Doc

public

getWebhook(webhookID: string): *

Get a webhook by its ID Jira Doc

public

issueLink(link: object): *

Create an issue link between two issues

public

listComponents(project: string): *

List Components Jira Doc

public

listFields(): *

List all fields custom and not that jira knows about.

public

List all Issue Types jira knows about Jira Doc

public

List all priorities jira knows about Jira Doc

public

List all Viewable Projects Jira Doc

public

listTransitions(issueId: string): *

List Transitions for a specific issue that are available to the current user Jira Doc

public

List all registered webhooks Jira Doc

public

makeRequestHeader(uri: string, otherOptions: object): *

public

makeUri(pathName: string): *

public

registerWebhook(webhook: object): *

Register a webhook Jira Doc

public

searchJira(searchString: string, optional: object): *

Pass a search query to Jira Jira Doc

public

Search user on Jira Jira Doc

public

transitionIssue(issueId: string, issueTransition: object): *

Transition issue in Jira Jira Doc

public

updateIssue(issueId: string, issueUpdate: object): *

Update issue in Jira Jira Doc

public

updateVersion(version: string): *

Update a version Jira Doc

Public Constructors

public constructor(options: *) source

Params:

NameTypeAttributeDescription
options *

Public Members

public apiVersion: * source

public base: * source

public host: * source

public password: * source

public port: * source

public protocol: * source

public request: * source

public strictSSL: * source

public username: * source

Public Methods

public addAttachmentOnIssue(issueId: string, readStream: object): * source

Add attachment to a Issue

Params:

NameTypeAttributeDescription
issueId string

issue id

readStream object

readStream object from fs

Return:

*

public addComment(issueId: string, comment: string): * source

Add a comment to an issue Jira Doc

Params:

NameTypeAttributeDescription
issueId string

Issue to add a comment to

comment string

string containing comment

Return:

*

public addIssueToSprint(issueId: string, sprintId: string): * source

Add an issue to the project's current sprint

Params:

NameTypeAttributeDescription
issueId string

the id of the existing issue

sprintId string

the id of the sprint to add it to

Return:

*

public addNewComponent(component: object): * source

Add component to Jira Jira Doc

Params:

NameTypeAttributeDescription
component object

Properly Formatted Component

Return:

*

public addNewIssue(issue: object): * source

Add issue to Jira Jira Doc

Params:

NameTypeAttributeDescription
issue object

Properly Formatted Issue object

Return:

*

public addWatcher(issueKey: string, username: string): * source

Add a user as a watcher on an issue

Params:

NameTypeAttributeDescription
issueKey string

the key of the existing issue

username string

the jira username to add as a watcher to the issue

Return:

*

public addWorklog(issueId: string, worklog: object, newEstimate: object): * source

Add a worklog to a project Jira Doc

Params:

NameTypeAttributeDescription
issueId string

Issue to add a worklog to

worklog object

worklog object from the rest API

newEstimate object

the new value for the remaining estimate field

Return:

*

Params:

NameTypeAttributeDescription
issueNumber string

The issue number to create the remotelink under

remoteLink object

the remotelink object as specified by the Jira API

Return:

*

public createVersion(version: string): * source

Create a version Jira Doc

Params:

NameTypeAttributeDescription
version string

an object of the new version

Return:

*

public deleteComponent(componentId: string): * source

Delete component from Jira Jira Doc

Params:

NameTypeAttributeDescription
componentId string

the Id of the component to delete

Return:

*

public deleteIssue(issueId: string): * source

Delete issue from Jira Jira Doc

Params:

NameTypeAttributeDescription
issueId string

the Id of the issue to delete

Return:

*

public deleteWebhook(webhookID: string): * source

Delete a registered webhook Jira Doc

Params:

NameTypeAttributeDescription
webhookID string

id of the webhook to delete

Return:

*

public deleteWorklog(issueId: string, worklogId: string): * source

Delete worklog from issue Jira Doc

Params:

NameTypeAttributeDescription
issueId string

the Id of the issue to delete

worklogId string

the Id of the worklog in issue to delete

Return:

*

public doRequest(requestOptions: object): * source

Params:

NameTypeAttributeDescription
requestOptions object

fields on this object get posted as a request header for requests to jira

Return:

*

public findIssue(issueNumber: string): * source

Params:

NameTypeAttributeDescription
issueNumber string

The issue number to search for including the project key

Return:

*

public findRapidView(projectName: string): * source

Find the Rapid View for a specified project

Params:

NameTypeAttributeDescription
projectName string

name for the project

Return:

*

public getBacklogForRapidView(rapidViewId: string): * source

Retrieve the backlog of a certain Rapid View

Params:

NameTypeAttributeDescription
rapidViewId string

rapid view id

Return:

*

public getCurrentUser(): * source

Describe the currently authenticated user Jira Doc

Return:

*

public getLastSprintForRapidView(rapidViewId: string): * source

Get a list of Sprints belonging to a Rapid View

Params:

NameTypeAttributeDescription
rapidViewId string

the id for the rapid view

Return:

*

public getProject(project: string): * source

Params:

NameTypeAttributeDescription
project string

key for the project

Return:

*

Retrieves the remote links associated with the given issue.

Params:

NameTypeAttributeDescription
issueNumber string

the issue number to find remote links for.

Return:

*

public getSprintIssues(rapidViewId: string, sprintId: string): * source

Get the issues for a rapidView / sprint

Params:

NameTypeAttributeDescription
rapidViewId string

the id for the rapid view

sprintId string

the id for the sprint

Return:

*

public getUnresolvedIssueCount(version: string): * source

Params:

NameTypeAttributeDescription
version string

the version of your product you want to find the unresolved issues of.

Return:

*

public getUsersInGroup(groupName: string, startAt: integer, maxResults: integer): * source

Get all users in group on Jira

Params:

NameTypeAttributeDescription
groupName string

A query string used to search users in group

startAt integer
  • optional
  • default: 0

The index of the first user to return (0-based)

maxResults integer
  • optional
  • default: 50

The maximum number of users to return (defaults to 50).

Return:

*

public getUsersIssues(username: string, open: boolean): * source

Get issues related to a user Jira Doc

Params:

NameTypeAttributeDescription
username string

username of user to search for

open boolean

determines if only open issues should be returned

Return:

*

public getVersions(project: string): * source

Get Versions for a project Jira Doc

Params:

NameTypeAttributeDescription
project string

A project key to get versions for

Return:

*

public getWebhook(webhookID: string): * source

Get a webhook by its ID Jira Doc

Params:

NameTypeAttributeDescription
webhookID string

id of webhook to get

Return:

*

Create an issue link between two issues

Params:

NameTypeAttributeDescription
link object

a link object formatted how the Jira API specifies

Return:

*

public listComponents(project: string): * source

List Components Jira Doc

Params:

NameTypeAttributeDescription
project string

key for the project

Return:

*

public listFields(): * source

List all fields custom and not that jira knows about. Jira Doc

Return:

*

public listIssueTypes(): * source

List all Issue Types jira knows about Jira Doc

Return:

*

public listPriorities(): * source

List all priorities jira knows about Jira Doc

Return:

*

public listProjects(): * source

List all Viewable Projects Jira Doc

Return:

*

public listTransitions(issueId: string): * source

List Transitions for a specific issue that are available to the current user Jira Doc

Params:

NameTypeAttributeDescription
issueId string

get transitions available for the issue

Return:

*

public listWebhooks(): * source

List all registered webhooks Jira Doc

Return:

*

public makeRequestHeader(uri: string, otherOptions: object): * source

Params:

NameTypeAttributeDescription
uri string
otherOptions object

an object containing fields and formatting how the

Return:

*

public makeUri(pathName: string): * source

Params:

NameTypeAttributeDescription
pathName string

The url after the /rest/api/version

Return:

*

public registerWebhook(webhook: object): * source

Register a webhook Jira Doc

Params:

NameTypeAttributeDescription
webhook object

properly formatted webhook

Return:

*

public searchJira(searchString: string, optional: object): * source

Pass a search query to Jira Jira Doc

Params:

NameTypeAttributeDescription
searchString string

jira query string in JQL

optional object

object containing any of the following properties

optional.startAt integer
  • optional
  • default: 0]:

optional starting index number

optional.maxResults integer
  • optional
  • default: 50]:

optional ending index number

optional.fields]: array
  • optional

optional array of string names of desired fields

Return:

*

public searchUsers(options: SearchUserOptions): * source

Search user on Jira Jira Doc

Params:

NameTypeAttributeDescription
options SearchUserOptions

Return:

*

public transitionIssue(issueId: string, issueTransition: object): * source

Transition issue in Jira Jira Doc

Params:

NameTypeAttributeDescription
issueId string

the Id of the issue to delete

issueTransition object

transition object from the jira rest API

Return:

*

public updateIssue(issueId: string, issueUpdate: object): * source

Update issue in Jira Jira Doc

Params:

NameTypeAttributeDescription
issueId string

the Id of the issue to delete

issueUpdate object

update Object as specified by the rest api

Return:

*

public updateVersion(version: string): * source

Update a version Jira Doc

Params:

NameTypeAttributeDescription
version string

an new object of the version to update

Return:

*