Hi there,
with a ScriptRunner validator on the issue creation workflow transition, I’m trying to verify that the assignee belongs to a specific group (not to a role).
I had no problems when testing it by assigning a task to myself (as administrator).
However, when I made this validator operational, an error came up because the property of belonging (or not belonging) to the group is not visible.
Any ideas on how to resolve this?
Using a project role is an option, but I would prefer to use groups.
Gaetano
Hi Gaetona,
Validators inside of ScriptRunner for Jira expression framework.
It sounds as if the group is not correctly configured for users, which is causing the validator to fail.
I would advise you to raise this as a support request here, so that the ScriptRunner support team can help debug the validator and identify the potential issue with the group.
I hope this helps.
Regards,
Kristian
The thing is, when you try to read user project roles or groups in a Jira expression, you need Project Administrator or Global Administrator permissions, respectively. Since the validator runs as the current user during a transition, and that user might not have those permissions, it won’t work in that case.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Broswe Groups and Users" global permission could be enough?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what official docs says:
groups
: The list of names for all the groups the user belongs to. Note that, while you can access your groups, you need Administer Jira global permission to see groups other users belong to (List<String>).groupIds
: The list of IDs of all the groups the user belongs to. Note that, while you can access your groups, you need Administer Jira global permission to see groups other users belong to (List<String>).getProjectRoles(project)
: Returns a list of project roles the user belongs to for a Project. Note that, while you can see the roles you belong to, you need Administer Projects project permission for the project or Administer Jira global permission to see roles of other users (List<ProjectRole>).You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, a new question:
If I fire a post function that checks whether the assignee belongs to a group before the issue is created, can I stop the transition (and therefore the creation of the issue), or would I have to delete it afterwards?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.