常用语句
Code Block |
---|
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
// Get the current user
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
// Get the changed field
def exampleField = getFieldById(getFieldChanged())
if (ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)?.find { it.name == "jira-administrators" }) { // <2>
exampleField.setAllowInlineEdit(true)
} else {
exampleField.setAllowInlineEdit(false)
} |