# Class: ProjectClient

## ProjectClient

## Constructor

#### new ProjectClient(jiraClient)

Used to access Jira REST endpoints in '/rest/api/2/project'

##### Parameters:

Name | Type | Description
--- | --- | ---
`jiraClient` | JiraClient |

Source:
  - api/project.js, line 5

### Methods

#### addToRole(opts, callback)

Add an actor to a project role.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key
`roleId` |  | The id of the role to retrieve.
`newRole` |  | See https://docs.atlassian.com/jira/REST/latest/#d2e134

`callback` |  | Called when the roles have been retrieved.

Source:
  - api/project.js, line 135

#### getAllProjects(opts, callback)

Returns all projects which are visible for the currently logged in user. If no user is logged in, it returns the list of projects that are visible when using anonymous access.

##### Parameters:

Name | Type | Description
--- | --- | ---
`opts` |  | Ignored
`callback` |  | Called when the projects have been retrieved.

Source:
  - api/project.js, line 13

#### getComponents(opts, callback)

Contains a full representation of a the specified project's components.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key

`callback` |  | Called when the components are retrieved.

Source:
  - api/project.js, line 48

#### getProject(opts, callback)

Contains a full representation of a project in JSON format.

All project keys associated with the project will only be returned if expand=projectKeys.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key

`callback` |  | Called when the project is retrieved.

Source:
  - api/project.js, line 32

#### getRole(opts, callback)

Details on a given project role.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key
`roleId` |  | The id of the role to retrieve.

`callback` |  | Called when the roles have been retrieved.

Source:
  - api/project.js, line 104

#### getRoles(opts, callback)

Contains a list of roles in this project with links to full details.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key

`callback` |  | Called when the roles have been retrieved.

Source:
  - api/project.js, line 90

#### getStatuses(opts, callback)

Get all issue types with valid status values for a project

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key

`callback` |  | Called when the statuses have been retrieved.

Source:
  - api/project.js, line 62

#### getVersions(opts, callback)

Contains a full representation of a the specified project's versions.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key

`callback` |  | Called when the versions have been retrieved.

Source:
  - api/project.js, line 76

#### updateRole(opts, callback)

Updates a project role to contain the sent actors.

##### Parameters:

Name | Type | Description
--- | --- | ---

`opts`

The request options sent to the Jira API.

###### Properties

Name | Type | Description
--- | --- | ---
`projectIdOrKey` |  | The project id or project key
`roleId` |  | The id of the role to retrieve.
`newRole` |  | See https://docs.atlassian.com/jira/REST/latest/#d2e108

`callback` |  | Called when the roles have been retrieved.

Source:
  - api/project.js, line 119