Class: GroupClient

GroupClient(jiraClient)

new GroupClient(jiraClient)

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

These are considered experimental according to the Jira Docs, use at your own risk.

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

addUserToGroup(opts, callbackopt) → {Promise}

Adds given user to a group. Returns the current state of the group.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Description
groupName string

A name of requested group.

userName string

The name of the user to add to the group.

callback <optional>

Called when the user has been added to the group.

Source:
Returns:

Resolved when the user has been added to the group.

Type
Promise

createGroup(opts, callbackopt) → {Promise}

Creates a group by given group parameter Returns REST representation for the requested group.

Parameters:
Name Type Attributes Description
opts

The request options sent to jira

Properties
Name Type Description
group

The group to create. See https://docs.atlassian.com/jira/REST/latest/#d2e2011

callback <optional>

Called when the group is created

Source:
Returns:

Resolved when the group is created

Type
Promise

deleteGroup(opts, callbackopt) → {Promise}

Deletes a group by given group parameter. Returns no content

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Attributes Description
groupName string

A group to delete.

swapGroup string <optional>

A group to transfer visibility restrictions of the group that is being deleted

callback <optional>

Called when the group has been deleted.

Source:
Returns:

Resolved when the group has been deleted.

Type
Promise

getGroup(opts, callbackopt) → {Promise}

Returns REST representation for the requested group. Allows to get list of active users belonging to the specified group and its subgroups if "users" expand option is provided. You can page through users list by using indexes in expand param. For example to get users from index 10 to index 15 use "users[10:15]" expand value. This will return 6 users (if there are at least 16 users in this group). Indexes are 0-based and inclusive. DEPRECATED. This resource is deprecated, please use group/member API instead. (15-Feb-2018)

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API

Properties
Name Type Description
groupName

A name of requested group.

expand

Array of fields to expand. Currently only available expand is "users".

callback <optional>

Called when the group is retrieved.

Source:
Returns:

Resolved when the group is retrieved.

Type
Promise

getMembers(opts, callbackopt) → {Promise}

This resource returns a paginated list of users who are members of the specified group and its subgroups. Users in the page are ordered by user names. User of this resource is required to have sysadmin or admin permissions.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Description
groupName String

A name of requested group.

includeInactiveUsers Boolean

inactive users will be included in the response if set to true. Default false.

startAt Number

the index of the first user in group to return (0 based).

maxResults Number

the maximum number of users to return (max 50).

callback <optional>

Called when the group is retrieved.

Source:
Returns:

Resolved when the group is retrieved.

Type
Promise

removeUserFromGroup(opts, callbackopt) → {Promise}

Removes given user from a group. Returns no content

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API

Properties
Name Type Description
groupName string

A name of requested group.

userName string

The name of the user to add to the group.

callback <optional>

Called when the user has been added to the group.

Source:
Returns:

Resolved when the user has been added to the group.

Type
Promise