Epics with a value in a custom field need to be transitioned to the next status only by a specified group of users. If the field does not have a value anyone can transition to the next status.
Hi,
You'd need add some condition in your workflow on that particular transition. If you have ScriptRunner add-on on your instance then you can add a Simple Scripted Condition and add some code to it.
Following code will restrict the transition, if the issue has the issuetype of Epic, it has that particular customfield present/filled out on that issue. So for such issues only users who are part of the "test" group will be able to make the transitions, if no such conditions exsist, then all the users would be able to transition the issue.
import com.atlassian.jira.component.ComponentAccessor
// Get the CustomField by its id
def customField = ComponentAccessor.customFieldManager.getCustomFieldObject(10200)
def loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
// Get the group of whose user are allowed the transition
def group = ComponentAccessor.groupManager.getGroup("test")
// Get all the groups of the logged in user
def groupsForUser = ComponentAccessor.groupManager.getGroupsForUser(loggedInUser)
// See if the issue is of Epic type and it has that particualr custom field
// and see if the user is part of the Groups gotten above
if (issue.getIssueType()?.name == "Epic"){
if (customField.getValue(issue)){
if (groupsForUser.contains(group)){
return true
}
else return false
}
else return true
}
else return true
Replace the id of the custom field you want, and also implement it on the particular transition condition that you want.
Tayyab - My apologies for not responding sooner. We are on Jira Software cloud and I was able to sort out the logic to create what I needed in a condition.
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.