https://scriptrunner.adaptavist.com/latest6.1.0-p5/jira/recipes/behaviours/setting-defaultapi-fieldsquickref.html#_setting_cascading_select_valueshtml?utm_source=product-help#_formfield_getvalue
常用语句
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)
} |