Class: ProjectClient

ProjectClient(jiraClient)

new ProjectClient(jiraClient)

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

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

addToRole(opts, callbackopt) → {Promise}

Add an actor to a project role.

Parameters:
Name Type Attributes 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 <optional>

Called when the roles have been retrieved.

Source:
Returns:

Resolved when the roles have been retrieved.

Type
Promise

createProject(project, callbackopt) → {Promise}

Creates a project.

Parameters:
Name Type Attributes Description
project

The project properties. See https://docs.atlassian.com/jira/REST/latest/#api/2/project

callback <optional>

Called when the project has been created.

Source:
Returns:

Resolved when the project has been created.

Type
Promise

deleteProject(opts, callbackopt) → {Promise}

Deletes a project

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
projectIdOrKey

The project id or project key

callback <optional>

Called when the project has been deleted.

Source:
Returns:

Resolved when the project has been deleted.

Type
Promise

getAllProjects(optsopt, callbackopt) → {Promise}

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 Attributes Description
opts Object <optional>

The request options sent to the Jira API.

Properties
Name Type Attributes Description
expand string <optional>
recent number <optional>
properties Array.<string> <optional>
callback callback <optional>

Called when the projects have been retrieved.

Source:
Returns:

Resolved when the projects have been retrieved.

Type
Promise

getComponents(opts, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
projectIdOrKey

The project id or project key

callback <optional>

Called when the components are retrieved.

Source:
Returns:

Resolved when the components are retrieved.

Type
Promise

getProject(opts, callbackopt) → {Promise}

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 Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
projectIdOrKey

The project id or project key

callback <optional>

Called when the project is retrieved.

Source:
Returns:

Resolved when the project is retrieved.

Type
Promise

getProjectProperties(opts, callbackopt) → {Promise}

Gets project propertes.

Parameters:
Name Type Attributes Description
opts

Options

Properties
Name Type Description
projectIdOrKey

The project id or project key

callback <optional>

Called when properties has been retrieved.

Source:
Returns:

Resolved when properties has been retrieved.

Type
Promise

getRole(opts, callbackopt) → {Promise}

Details on a given project role.

Parameters:
Name Type Attributes 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 <optional>

Called when the roles have been retrieved.

Source:
Returns:

Resolved when the roles have been retrieved.

Type
Promise

getRoles(opts, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
projectIdOrKey

The project id or project key

callback <optional>

Called when the roles have been retrieved.

Source:
Returns:

Resolved when the roles have been retrieved.

Type
Promise

getStatuses(opts, callbackopt) → {Promise}

Get all issue types with valid status values for a project

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
projectIdOrKey

The project id or project key

callback <optional>

Called when the statuses have been retrieved.

Source:
Returns:

Resolved when the statuses have been retrieved.

Type
Promise

getVersions(opts, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
projectIdOrKey

The project id or project key

callback <optional>

Called when the versions have been retrieved.

Source:
Returns:

Resolved when the versions have been retrieved.

Type
Promise

getVersionsPaginated(opts, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
projectIdOrKey string

The project id or project key

opt.startAt number <optional>

The index of the first item to return in a page of results

opt.maxResults number <optional>

The maximum number of items to return per page

opt.orderBy string <optional>

Order the results by a field

opt.query string <optional>

Filter the results using a literal string. Versions with matching name or description are returned (case insensitive).

opt.status string <optional>

A list of status values used to filter the results by version status

opt.expand Array <optional>

The fields to expand

callback callback <optional>

Called when the paginated representation of all versions have been retrieved.

Source:
Returns:

Resolved when the paginated representation of all versions have been retrieved.

Type
Promise

updateRole(opts, callbackopt) → {Promise}

Updates a project role to contain the sent actors.

Parameters:
Name Type Attributes 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 <optional>

Called when the roles have been retrieved.

Source:
Returns:

Resolved when the roles have been retrieved.

Type
Promise