Class: JiraClient

JiraClient(config)

new JiraClient(config)

Represents a client for the Jira REST API

Parameters:
Name Type Description
config

The information needed to access the Jira API

Properties
Name Type Attributes Default Description
host string

The hostname of the Jira API.

timeout number <optional>

request timeout (milliseconds)

protocol string <optional>
https

The protocol used to accses the Jira API.

port number <optional>
443

The port number used to connect to Jira.

path_prefix string <optional>
"/"

The prefix to use in front of the path, if Jira isn't at "/"

strictSSL boolean <optional>
true

It is recommended not to turn it off for no reason (https://github.com/request/request/issues/251).

version number | string <optional>
2

The version of the Jira API to which you will be connecting. Currently, only version 2 is supported.

basic_auth Object <optional>

The authentication information used tp connect to Jira. Must contain EITHER username and password OR oauth information. Oauth information will be used over username/password authentication.

Properties
Name Type Attributes Description
base64 Object <optional>

base64 that contains email:api_token.

username string <optional>

(DEPRECATED) The username of the user that will be authenticated. MUST be included if using username and password authentication.

password string <optional>

(DEPRECATED) The password of the user that will be authenticated. MUST be included if using username and password authentication.

email string <optional>

The email of the user that will be authenticated. MUST be included if using email and api_token authentication.

api_token string <optional>

The api token of the user that will be authenticated. MUST be included if using email and api_token authentication.

oauth.consumer_key string <optional>

The consumer key used in the Jira Application Link for oauth authentication. MUST be included if using OAuth.

oauth.private_key string <optional>

The private key used for OAuth security. MUST be included if using OAuth.

oauth.token string <optional>

The VERIFIED token used to connect to the Jira API. MUST be included if using OAuth.

oauth.token_secret string <optional>

The secret for the above token. MUST be included if using Oauth.

jwt Object <optional>

The JWT configuration object that contains iss:secret

Properties
Name Type Attributes Description
iss string

The Jira app key (can be found in the app descriptor). MUST be included

secret string

The JWT secret token. MUST be included

expiry_time_seconds string <optional>

The JWT token expiry time in seconds. OPTIONAL (default 180 seconds)

cookie_jar CookieJar <optional>

The CookieJar to use for every requests.

promise Promise <optional>

Any function (constructor) compatible with Promise (bluebird, Q,...). Default - native Promise.

request Request <optional>

Any function (constructor) compatible with Request (request, supertest,...). Default - require('request').

Properties:
Name Type Description
board AgileBoardClient
sprint AgileSprintClient
applicationProperties ApplicationPropertiesClient
attachment AttachmentClient
auditing AuditingClient
auth AuthClient
avatar AvatarClient
comment CommentClient
component ComponentClient
customFieldOption CustomFieldOptionClient
dashboard DashboardClient
developmentInformation DevelopmentInformationClient
field FieldClient
filter FilterClient
group GroupClient
groupUserPicker GroupUserPickerClient
groups GroupsClient
issue IssueClient
issueLink IssueLinkClient
issueLinkType IssueLinkTypeClient
issueType IssueTypeClient
jql JqlClient
labels LabelsClient
licenseRole LicenseRoleClient
licenseValidator LicenseValidatorClient
myPermissions MyPermissionsClient
myPreferences MyPreferencesClient
myself MyselfClient
password PasswordClient
permissions PermissionsClient
permissionScheme PermissionSchemeClient
priority PriorityClient
projectCategory ProjectCategoryClient
project ProjectClient
projectValidate ProjectValidateClient
reindex ReindexClient
resolution ResolutionClient
roles RoleClient
screens ScreensClient
search SearchClient
securityLevel SecurityLevelClient
serverInfo ServerInfoClient
settings SettingsClient
statusCategory StatusCategoryClient
status StatusClient
user UserClient
version VersionClient
webhook WebhookClient
workflow WorkflowClient
workflowScheme WorkflowSchemeClient
worklog WorklogClient
Source:

Methods

buildAbstractURL(path) → {string}

Simple utility to build a REST endpoint URL for the Jira API without prefixes.

Parameters:
Name Type Description
path

The path of the URL without concern for the root of the REST API.

Source:
Returns:

The constructed URL.

Type
string

buildAgileURL(path, forcedVersionopt) → {string}

Simple utility to build a REST endpoint URL for the Jira Agile API.

Parameters:
Name Type Attributes Description
path

The path of the URL without concern for the root of the REST API.

forcedVersion string | number <optional>

Use this param to force a particular version

Source:
Returns:

The constructed URL.

Type
string

buildAuthURL(path, forcedVersionopt) → {string}

Simple utility to build a REST endpoint URL for the Jira Auth API.

Parameters:
Name Type Attributes Description
path

The path of the URL without concern for the root of the REST API.

forcedVersion string | number <optional>

Use this param to force a particular version

Source:
Returns:

The constructed URL.

Type
string

buildURL(path, forcedVersionopt) → {string}

Simple utility to build a REST endpoint URL for the Jira API.

Parameters:
Name Type Attributes Description
path

The path of the URL without concern for the root of the REST API.

forcedVersion string | number <optional>

Use this param to force a particular version

Source:
Returns:

The constructed URL.

Type
string

buildWebhookURL(path, forcedVersionopt) → {string}

Simple utility to build a REST endpoint URL for the Jira webhook API.

Parameters:
Name Type Attributes Description
path

The path of the URL without concern for the root of the REST API.

forcedVersion string | number <optional>

Use this param to force a particular version

Source:
Returns:

The constructed URL.

Type
string

makeRequest(options, callbackopt, successStringopt) → {Promise}

Make a request to the Jira API and call back with it's response.

Parameters:
Name Type Attributes Description
options

The request options.

callback callback <optional>

Called with the APIs response.

successString string <optional>

If supplied, this is reported instead of the response body.

Source:
Returns:

Resolved with APIs response or rejected with error

Type
Promise