# Class: JiraClient

## JiraClient

## Constructor

#### 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.
`protocol` | string | <optional> | https | The protocol used to accses the Jira API.
`port` | number | <optional> | 443 | The port number used to connect to Jira.
`version` | string | <optional> | 2 | The version of the Jira API to which you will be connecting. Currently, only version 2 is supported.
`auth` |  |  |  | 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.
`basic_auth.username` | string | <optional> |  | The username of the user that will be authenticated. MUST be included if using username and password authentication.
`basic_auth.password` | string | <optional> |  | The password of the user that will be authenticated. MUST be included if using username and password 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.
`cookie_jar` | CookieJar | <optional> |  | The CookieJar to use for every requests.

##### Properties:

Name | Type | Description
--- | --- | ---
`issue` | IssueClient |
`applicationProperties` | ApplicationPropertiesClient |
`attachment` | AttachmentClient |
`auditing` | AuditingClient |
`avatar` | AvatarClient |
`comment` | CommentClient |
`issueLink` | IssueLinkClient |
`issueLinkType` | IssueLinkTypeClient |
`groups` | GroupsClient |
`groupUserPicker` | GroupUserPickerClient |
`customFieldOption` | CustomFieldOptionClient |
`jql` | JqlClient |
`licenseValidator` | LicenseValidatorClient |
`myPermissions` | MyPermissionsClient |
`projectValidate` | ProjectValidateClient |
`securityLevel` | SecurityLevelClient |
`serverInfo` | ServerInfoClient |
`dashboard` | DashboardClient |
`field` | FieldClient |
`issueType` | IssueTypeClient |
`priority` | PriorityClient |
`reindex` | ReindexClient |
`resolution` | ResolutionClient |
`search` | SearchClient |
`status` | StatusClient |
`statusCategory` | StatusCategoryClient |
`licenseRole` | LicenseRoleClient |
`myPreferences` | MyPreferencesClient |
`myself` | MyselfClient |
`password` | PasswordClient |
`settings` | SettingsClient |
`component` | ComponentClient |
`group` | GroupClient |
`workflow` | WorkflowClient |
`filter` | FilterClient |
`screens` | ScreensClient |
`version` | VersionClient |
`project` | ProjectClient |
`user` | UserClient |
`workflowScheme` | WorkflowSchemeClient |

Source:
  - index.js, line 53

### Methods

#### buildURL(path) → {string}

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`path` |  | The path of the URL without concern for the root of the REST API.

Source:
  - index.js, line 208

##### Returns:

The constructed URL.

Type
  string

#### makeRequest(options, callback, successStringopt)

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

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`options` |  |  | The request options.
`callback` |  |  | Called with the APIs response.
`successString` | string | <optional> | If supplied, this is reported instead of the response body.

Source:
  - index.js, line 229