Not able to copy security level to subtask from Parent

MoinP March 19, 2015

I am using script runner plugin to create subtask but subtask created from this plugin post function does not copy security level. Though it inherits from parent , I want security level should be visible to subtask as well.

Please help

3 answers

0 votes
MoinP March 20, 2015

Nic,

I don't want to set security level explicitly but just want the default inherited security to visible in subtask.

Please help

Andrey Kuzmin
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.
March 20, 2015

Moin, as I said above you should use that line of code. If you create subtask via groovy-scripts security level is not being copied.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2015

The code will break the security level system - you should not set the field. Whet you need is a display of the security level, not to try to wedge the field into the data. I'd use the script-runner to create a scripted field that simply echoes out the security level of the parent. Couple of lines of code at worst.

Andrey Kuzmin
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.
March 20, 2015

Nic, the problkem here is that it does NOT echo security level, like you say. And that's why I was using that line of code. Well at time I had Jira 6.2 and Script runner 2.*. I am going to try again on 6.3.12 and latest script runner and tell you results.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2015

I think you're misunderstanding the point. Your code will BREAK Jira because it sets a security level on an issue that should not have the level set. The answer is NOT to set the security level, then answer is to display the effective one

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2015

Er, you don't.

Sub-tasks inherit the security of their parent.  You can't set it independently (if you try it, things break in interesting ways)

Carlos David November 20, 2017

[clarification] hiding the security level on a subtask in its field configuration removes the security level entirely (it does not inherit).

0 votes
Andrey Kuzmin
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.
March 19, 2015

Try

issueInputParameters.setSecurityLevelId(issue.getSecurityLevelId());

also be sure to use this API to create/update your issues.

 

Suggest an answer

Log in or Sign up to answer