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,
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.
Regards,
Kristian
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohamed. Thank you so much. I'll try your suggestions.
Regards. 😀
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.