Hi All,
what should be the script for project role(like: Tester) condition on transition?
Means, only testers would be visible on particular transition.
I was trying this : isUserMemberOfRole('Testers') , but it's not working.
Thanks.
Hi @Pankaj You are trying to set up a condition, users which are in Tester project role only have permission to transition this issue, right ?
Instead of writing a scripted condition, you can this Condition Project role(s) condition [ScriptRunner] : Allows the transition if the current user is, or is not, a member of the specified project role(s).
Hi @Pankaj
Did you try to use 'User Is In Project Role' condition?
Regards,
Seba
yes , I tried still not working
yes , this condition is working , but I want to try through writing the script i.e , inline script.
@Pankaj I think you are trying to add Custom Scripted Condition, for this try below script :-
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.security.roles.ProjectRoleManagerdef currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()def projectRoleManager = ComponentAccessor.getComponentOfType(com.atlassian.jira.security.roles.ProjectRoleManager)def testerRole = projectRoleManager.getProjectRole("Tester")def project = issue.getProjectObject()def userInTesterRole = projectRoleManager.isUserInProjectRole(currentUser, testerRole, project)log.warn userInTesterRolepassesCondition = userInTesterRole
yes its working , but could you please exlain the code step by step that will be very clear understanding for me or else we can able to write next condition or something by ourself.
Thank You very much.
It looks like you're new here. Sign in or register to get started.