Set Issue Security based on select list type custom field value

Software Asset Management October 13, 2016

I have a requirement where user wants to restrict issue view only when a specific custom field value is *Yes*.

I know this is not directly achievable. Is there a way where I can implement the same?

 

1 answer

1 vote
JamieA
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.
October 17, 2016

You can use the set issue security built-in script to do this... 

If you want to do it from a listener the code is just:

issue.setSecurityLevelId(secLevel.id)
Software Asset Management October 19, 2016

Hello Jamie,

 

I implemented the security but still users are able to see the issue on Read-Only Mode. I want issue not to be visible when customfield value is YES.

Can you please guide further?

 

Thanks,

Thanos Batagiannis _Adaptavist_
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.
October 27, 2016

to 'clear' the security level you should 

issue.setSecurityLevelId(null)

therefore you can have an (pseudocode)

if (cfValue == 'yes') {
	issue.setSecurityLevelId(null)
} else if (cfValue == 'no') {
	issue.setSecurityLevelId(secLevel.id)
} else {
	//something else 
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events