Hi everyone,
I need to create a behavior in ScriptRunner that retrieves the current user and then checks their role in the Jira project where they are trying to create an issue. I appreciate your help in determining whether this can be achieved in Jira Cloud.
Hi @Mauricio Rodriguez ,
It is unclear what you mean by "checks their role".
If you are open to using apps, you can use Roles Dashboard for Jira , an app released by our company.
In the two perspectives, you can have a clear picture of how your user is part of roles, either by being assigned to a role directly, or by being part of a group that is assigned to the role.
You can export your result to csv for further analysis.
Regards,
Petru
Hi,
I think you will need to retrieve the project role used by the current project then iterate over each role and search for the current user in each role.
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-roles#api-group-project-roles
in behaviour you can use the getContext method to access the current project and more infos
https://docs.adaptavist.com/sr4jc/latest/features/behaviours/behaviours-api
Hi Mohamed. Thank you so much. I'll try your suggestions.
Regards. 😀
Hi Mauricio,
I can confirm with Behaviours in Jira Cloud you need to retrieve the roles from the context to check them.
We have a couple of example scripts in the docs linked below that show how to do this that you can use as a guide to help create the script that you require.
Examples:
I hope this helps.
Kristian
It looks like you're new here. Sign in or register to get started.