Hi,
it's simple to set set security level within a groovy script f.e. in a post function. That's working.
But how do I set the security level using the behaviour plugin?
I want to set a security level if a checkbox "confidential" is enabled.
Problem : How do set the security level on the issue and how to store?
This ist not working:
IssueSecurityLevelManager issueSecurityLevelManager = ComponentAccessor.getIssueSecurityLevelManager ();
Object id = getFieldById("id")
MutableIssue missue=ComponentManager.getInstance().getIssueManager().getIssueObject(Long.parseLong(id.value))
IssueSecurityLevel secLevel= issueSecurityLevelManager.getSecurityLevel (10130L);
missue.setSecurityLevelId(secLevel.id);
missue.store();
Thanks
Dieter
Community moderators have prevented the ability to post new answers.
Thanks Jamie for your reply.
For a post-function a transition in the workflow is needed. I want to change the sec. level before during edit of call.
It works when I just hide the sec level box in the edit mask.
And I found your hint using getUnderlyingIssue()
IssueSecurityLevelManager issueSecurityLevelManager = ComponentAccessor.getIssueSecurityLevelManager ();
IssueSecurityLevel secLevel= issueSecurityLevelManager.getSecurityLevel (10130L);
getUnderlyingIssue().setSecurityLevelId(secLevel.id);
getUnderlyingIssue().store();
Thanks
Dieter
If the confidential checkbox is selected, then just set the security level in a post-function...
I suspect the way you are doing it there, when the user saves the form, it's just overwriting the security level with whatever the browser sends, even if it's nothing. I don't think you should modify the issue in the background from the behaviour, and if you did you should use IssueManager or IssueService to update the issue.
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.