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:
- This routine is available starting with katl-commons 2.0.6.
- This routine is available for Jira server and cloud deployment options.
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.
|User||String||Yes||Username or userkey of the user in question.|
Key of the selected project.
Name of the role that is verified.
Returns "true" if the user has the role on a project and "false" otherwise.
Example 1 (Server)
return isUserInRole("mike", "PRJ", "Developers");
Example 2 (both cloud and server versions)
return isUserInRole(currentUser(), "PRJ", "Developers");
Example 3 (Cloud)
return isUserInRole("557058:b540463d-d7fb-43a9-b440-85e1cdbb201e", "PRJ", "Developers");
On the server the look-up is first made after the userkey, then after the username. On cloud, the look-up is done only by userkey.