How to set Security Level with "Automation" plugin....

B_ Normann P_ Nielsen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2015

How can I use the (great) https://marketplace.atlassian.com/plugins/com.atlassian.plugin.automation.jira-automation-plugin to set Issue Security Level ?

I have tried:

level=OnlySeeOwn

level=10000

$issue.level=OnlySeeOwn

$issue.level=10000

 

the latter 2 as "expanded".

 

But the SL is not changed

6 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Wolfgang Fellner August 16, 2016

Solution:

use

security=<your security-level-id>

Example:

solution.PNG

Joseph Than December 15, 2016

Thanks for the answer. Mis-read this at first, and then re-read to realize we had to use security instead of level.

0 votes
B_ Normann P_ Nielsen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2015

Cant add a screenshot here for some reason, but I run a groovy script (via the apdatavist Scriptrunner - soon to be paid for... :-( ) {code}npn@docs02:/pack/jira-groovy$ cat /pack/jira-groovy/set-security-level-from-parent.groovy import com.atlassian.jira.issue.Issue import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.fields.CustomField import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.util.ImportUtils import com.atlassian.jira.issue.index.IssueIndexManager import com.atlassian.jira.issue.security.IssueSecurityLevelManager import com.atlassian.jira.issue.security.IssueSecuritySchemeManager String issuekey = issue.key System.out.println("script=set-security-level-from-parent.groovy action=StartScript key=" + issuekey); Issue parentissue = issue.getParentObject() String parentissuekey=parentissue.key System.out.println("script=set-security-level-from-parent.groovy action=StartScript key=" + issuekey + " parentkey=" + parentissuekey) Integer parentsecuritylevel = parentissue.securityLevel?.id String parentsecuritylevelname = parentissue.securityLevel?.name if (parentsecuritylevel == 10000) { System.out.println("script=set-security-level-from-parent.groovy action=StartScript key=" + issuekey + " Set Security Level to " + parentsecuritylevelname + " from " + parentissuekey) issue.setSecurityLevelId(parentsecuritylevel) } System.out.println("script=set-security-level-from-parent.groovy action=EndScript"); {code} Feel free to use :-) I know the imports can be cleaned up.... PS: 10000 is the only Security Level I have on projects

0 votes
Andreas Heinbokel September 28, 2015

Norman, how did you setup the "change of security level" on the transition? When I select "Post function" -> "Update Issue field" there is no "Security Level" field to set/change.

0 votes
B_ Normann P_ Nielsen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2015

Yes - And no.... I actually had to make a workflow Transition setting the Security Level, and then letting the Automation perform that to make it work.... not optimal, but it works....

0 votes
Tom Jackson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2015

Any luck getting this to work Normann?

0 votes
B_ Normann P_ Nielsen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2015

Strange part is I can but almost whatever fieldname in, the "Errors" column stays empty in the Audit log

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events