I have a validator expression but it requires elevated permissions because I am trying to retrieve the Project Roles of the current assignee to ensure that they are in an appropriate role for assignment.
The script is pretty simple:
roles = "Role A, Role B, Role C"
issue.assignee.getProjectRoles(project)
.map(r => r.name)
.filter(i => roles.includes(i))
.length > 0
This will check to see if any of the project roles is one of the listed roles.
The problem is that I get an error message: "You must be the project administrator to access roles of other users"
Is there any way to run this as the add-on user rather than as the current user?
Hi Derek,
Thank you for your question.
I can confirm that currently in ScriptRunner for Jira Cloud tht validators can only be run as the current user.
The reason for this is that they use the Jira expression framework that Atlassian provides for this feature and do not interact with the rest API like other scripts.
If this a feature you would find valuable then can you please raise this as a card on our feature board located here so that the product owner for ScriptRunner for Jira cloud can see this.
I hope this information helps.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.