Hello guys,
I am implementing a java plugin to manage automatic apply of security issue on JIRA Core. I can apply security level on update event with custom security rule. I want to add a custom behaviour which is :
My issue has a security level applied.
if no automatic security rules apply anymore
then remove the security level programmatically
I tried :
MutableIssue mi = issueManager.getIssueByCurrentKey(event.getIssue().getKey());
mi.setSecurityLevelId(-1L);
issueManager.updateIssue(adminUser, mi, EventDispatchOption.DO_NOT_DISPATCH,
false);
or
mi.setSecurityLevelId(null);
issueManager.updateIssue(adminUser, mi, EventDispatchOption.DO_NOT_DISPATCH,
false);
This code does not apply what I expected, I do not know how to proceed, do you have a suggestion ? 
Thank you in advance