i want to limit specified people(who is assignee or with 'SWTL' role or wiht 'Administer Projects' permission) to Resolve Issues.
the first two condition i have test OK :
currentUser == issue.assignee || isUserMemberOfRole('SWTL')
the third one ,i try to use hasPermission('Administer Projects') in Condition Tester
No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.hasPermission() is applicable for argument types:
(java.lang.String) values: [Administer Projects]
anyone knows the correct syntax of permission validator in groovy runner?
> anyone knows the correct syntax of permission validator in groovy runner?
You mean the correct API to use in either java or groovy? There is no "different API" for groovy by the way.
import com.atlassian.jira.security.Permissions componentManager.getPermissionManager().hasPermission(Permissions.ADMINISTER, currentUser)
Thanks very much ,Jamie
i used below code ,and succeed.
ComponentManager componentManager = ComponentManager.getInstance()
currentUser == issue.assignee || isUserMemberOfRole('SWTL') || componentManager.getPermissionManager().hasPermission(Permissions.PROJECT_ADMIN,issue, currentUser)
i have to add " import com.atlassian.jira.ComponentManager" and "ComponentManager componentManager = ComponentManager.getInstance()" ,otherwise in Condition Tester will returns
javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: componentManager for class: Script23
in com/onresolve/jira/groovy/canned/utils/ConditionUtils.groovy of Groovy Runner Plugin
has already define "ComponentManager componentManager = ComponentManager.getInstance()",i am wonder why i have to redefine 'componentManager' ?
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG