Warning |
---|
The availability of the users personal data may be impacted by the recent changes by Atlassian in order to meet GDPR compliance. See the following for more information: |
Info |
---|
|
This routine is available starting with katl-commons 2.0.6. This routine is available for Jira server and cloud deployment options. Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | isUserInRole(user,project, role) | Package | | Alias | | Pkg Usage | | |
Description
Excerpt |
---|
|
Returns "true" if the user has a certain role on the specified project. |
This routine exists starting with Power Scripts for Jira 2.0.6. Before that, you have to get the roles of the user on the project, then check if the necessary role is in the returned list.
...
Returns "true" if the user has a certain role on the specified project.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
User | String | Yes | Username or userkey of the user in question. | Project key | String | Yes | Key of the selected project. | Role name | String | Yes | Name of the role that is verified. | |
Return
...
Type
boolBoolean
Returns "true" if the user has the role on a project and "false" otherwise.
Example
Example 1 (Server)
Code Block |
---|
return isUserInRole("mike", "PRJ", "Developers");
|
Example 2 (both cloud and server versions)
Code Block |
---|
return isUserInRole(currentUser(), "PRJ", "Developers");
|
Example 3 (Cloud)
Code Block |
---|
return isUserInRole("557058:b540463d-d7fb-43a9-b440-85e1cdbb201e", "PRJ", "Developers");
|
...
...
The look-up is first made after the userkey, then after the username |
...
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "jirauser_security_routine" and space = currentSpace ( ) |
---|
labels | jiraarray_security_routineroutines |
---|
|