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?