I have a shared transition from two statuses (e.g. "open" and "verified") to one (e.g. "ready").
I want to enable users to use the transition when the source status is "verified".
Only users of two project roles (e.g. "admin", "heros") should be allowed to use the transition from "open" ro "ready" without going over "verified".
I set up the following Groovy script to accomplish the first part but struggle with the roles.
def project = issue.getProjectObject();
log.debug( project.getLeadUserKey() );
def verifiedStatusId = "10008";
// God mode (check for Project Leads or Administrators)
// Regular mode (check if source status is "Verified")
if ( issue.getStatusId() == verifiedStatusId ) {
return true;
}
return false;
Currently I see no way to determine the project roles assigned to the current user by the user object itself. Also the getProjectObject() just returns very generic methods (e.g. project name) which are irrelevant for my task.
How to I check if the current user is in one or more of two project roles of the issue of the project?