Hi All,
In my Jira project, we have 3 issue types and we have 5 users groups ADMIN, USERS, READERS, ScrumMaster and DEVELOPER. I want to put complete restriction to DEVELOPER groups to create one issues type in our project i.e DEVELOPER is not able to create and view one issue type and rest two he is able to create and view.
I am using validator script in issue workflow to restrict them but with that script, no groups are able to create that issues which I want to restrict for a developer.
I am adding validator script also with this. Can somebody help me solve this problem?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.crowd.embedded.api.Group
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.user.ApplicationUser
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.user.util.UserUtil
import com.atlassian.jira.security.groups.GroupManager
import java.util.List
import com.atlassian.jira.ComponentManager
def groupManager = ComponentManager.getComponentInstanceOfType(GroupManager.class)
def currentUser = ComponentAccessor.JiraAuthenticationContext.getLoggedInUser()
GroupManager.isUserInGroup(currentUser,"JIR_ADMIN,JIR_SCRUM MASTER,JIR_USER,JIR_READER,JIR_ADMIN,JIR_SCRUM MASTER,JIR_USER,JIR_READER,JIR_ADMIN,JIR_SCRUM MASTER,JIR_USER,JIR_READER")
It should be like this:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.crowd.embedded.api.Group
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.user.ApplicationUser
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.user.util.UserUtil
import com.atlassian.jira.security.groups.GroupManager
import java.util.List
import com.atlassian.jira.ComponentManager
def groupManager = ComponentManager.getGroupManager()
def currentUser = ComponentAccessor.JiraAuthenticationContext.getLoggedInUser()
return groupManager.isUserInGroup(currentUser,"JIR_ADMIN") || groupManager.isUserInGroup(currentUser,"JIR_SCRUM ") || groupManager.isUserInGroup(currentUser,"JIR_SCRUM MASTER") ... and so on for all groups.
Also you should name groups as they are name in Jira. It is case sensitive.
Hi @Alexey Matveev,
Thanks For your suggestion. Again I am facing the problem. None of the group users are able to create an issue in Jira.
Regards,
Shubhanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.