Hi,
Using Behaviour, how can we check if Security Level field (which is a JIRA System field) is hidden on screen ?
This is rough so you would want to flesh out the logic, but in general this should work.
import com.atlassian.jira.component.ComponentAccessor
def issue = getUnderlyingIssue()
def sec = getFieldById("security")
log.debug issue?.getSecurityLevelId().toString()
log.debug sec?.getValue().toString()
if (issue?.getSecurityLevelId().toString() == sec?.getValue().toString()) {
log.debug "Security Level not hidden"
} else {
log.debug "Security Level hidden"
}
There are other approaches (like using the Field Config API) but I think this one is very simple.
Hi. If this answer helped, please use the check mark to accept the answer. Thanks!
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.