Skip to end of metadata
Go to start of metadata

Cprime Apps has been rebranded as Anova Apps. Please note the only effect is the company name - all of our products’ names, logos, functionalities, support, etc. is exactly the same. The new location to our documentation space is https://anovaapps.atlassian.net.

Availability

This routine is available starting with katl-commons 2.5.15 for Jira 5.x / 2.6.7 for Jira 6.

This routine is available for Jira server and cloud deployment options.

Syntax

admAddUserToProjectRole(user, project, role)

Alias

addUserToProjectRole(user, project, role)

Description

Adds a single user to a project role if the user is not already in that role.

Parameters

Parameter name

Type

Required

Description

UserStringYesUsername or userkey.

Project key

String

Yes

Key of the selected project.

Role name

String

Yes

Name of the role to add the user to.

Return type

boolean starting with 2.5.16 / 2.6.8.

Returns "true" if operation succeeded.

Example

admAddUserToProjectRole("user.3", "TEST", "Developers");

Notes

The look-up is first made after the userkey, then after the username.

See also