I want to automate/set the Issue Security Level from with a groovy script (in a listener script, based on some other info in the issue).
Next code seems to work:
...
mutableIssue.setSecurityLevelId(issueSecurityLevelId)
issueManager.updateIssue(securityUser, mutableIssue, EventDispatchOption.DO_NOT_DISPATCH, false)
...
where issueSecurityLevelId is the id of a Issue Security Level that is in a scheme associated with the project the issue is in. And securityUser is a user that has the rights in the project to set the Issue Security Level.
For my test I hard coded the Issue Security Level id.
But my question: how to find the issue Security Levels that can be used with the current project ? Or how to get the Issue Security Scheme associated with the project, and how to get the Issue Security Levels in the Scheme ?