Class: RoleClient

RoleClient(jiraClient)

new RoleClient(jiraClient)

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

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

addActors(opts, callbackopt) → {Promise}

Adds default actors to the given role. The request data should contain a list of usernames or a list of groups to add.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
roldId String

Identifier for the role.

group Array

Array of group ids.

user Array

Array of user ids.

callback <optional>

Called when the permissions have been returned.

Source:
Returns:

Resolved when the permissions have been returned.

Type
Promise

createRole(opts, callbackopt) → {Promise}

Creates a new ProjectRole to be available in Jira. The created role does not have any default actors assigned.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
role

See https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-role-post

callback <optional>

Called when the scheme has been created.

Source:
Returns:

Resolved when the scheme has been created.

Type
Promise

deleteRole(opts, callbackopt) → {Promise}

Deletes a role. May return 403 in the future

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
roldId String

Identifier for the role.

swap String

if given, removes a role even if it is used in scheme by replacing the role with the given one

callback <optional>

Called when the permissions have been returned.

Source:
Returns:

Resolved when the permissions have been returned.

Type
Promise

getActors(opts, callbackopt) → {Promise}

Gets default actors for the given role.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
roldId String

Identifier for the role.

callback <optional>

Called when the permissions have been returned.

Source:
Returns:

Resolved when the permissions have been returned.

Type
Promise

getAll(opts, callbackopt) → {Promise}

Get all the ProjectRoles available in Jira. Currently this list is global.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

callback <optional>

Called when the permissions have been returned.

Source:
Returns:

Resolved when the permissions have been returned.

Type
Promise

getRoleById(opts, callbackopt) → {Promise}

Get a specific ProjectRole available in Jira.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

callback <optional>

Called when the permissions have been returned.

Source:
Returns:

Resolved when the permissions have been returned.

Type
Promise

removeActor(opts, callbackopt) → {Promise}

Removes default actor from the given role.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
roldId String

Identifier for the role.

group String

group id.

user String

user id.

callback <optional>

Called when the permissions have been returned.

Source:
Returns:

Resolved when the permissions have been returned.

Type
Promise

updateRole(opts, callbackopt) → {Promise}

Fully updates a roles. Both name and description must be given.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
roldId

Identifier for teh role.

role

Object containing the name and description to be updated.

callback <optional>

Called when the permissions have been returned.

Source:
Returns:

Resolved when the permissions have been returned.

Type
Promise