Hi Everyone,
I am trying to set security level as per component selected on ticket using behavior settings in scriptrunner.
I want to set once ticket created as per workflow transition then if they update ticket or change component it should reflect security level immidiately on ticket.
here what I am using but another question is how to get security ID's, I think we can't use security level values.
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
def component = getFieldById("components")
def componentV = component.getValue()
if (componentV.toString().contains("NTD")) {
issue.setSecurityLevelId(10000);
}
else {
issue.setSecurityLevelId(10001);
}