We have a Requirement to restrict some users for creating particular issue types
For eg - User1 (these are included in a particular Grp ) cannot Create EPIC
We have Scriptrunner and Automation any way we can do it?
Hi @Sanjivani Wayal ,
To restrict Create Epic to users in a particular group, add the below Jira Expression Validator(Script Runner Jira Expression) to the Create Screen of Epic.
!user.groups.includes('Developers')
You can use a groovy validator (Post-Function) on the Create transition of your Workflow to accomplish this.
Hi @Somnath Patil Can you please help with this where exactly do i need to write this is it in Script Console of Script runner or on some validator or Post function in workflow ?
Hi @Judah Which Post-Function should i use on Create Transition?
As you mentioned you have ScriptRunner. Add validator on a create screen of Epic and use ScriptRunner Script validator and paste this cod : !user.groups.includes('Developers')
Replace Developers group name with the name you want to restrict.
I did that , its not working maybe because i have name of group of users is need to restrict like "JIRA_GRP1" and not a specific name or a single user
@Sanjivani Wayal - You will need to add a Validator. If the validator returns false the transition will be denied (the issue wont be created). We used the Scripted (Groovy) Validator provided by JMWE, but ScriptRunner also provides an option for a scripted validator and you would likely pass something like this into the script editor.
ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "<YOUR GROUP>")
The expression must return TRUE for the transition to occur.
It looks like you're new here. Sign in or register to get started.