Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to use a ScriptRunner user picker field with issue security?

Joshua DeClerck
Contributor
January 30, 2020

ScriptRunner fields support being rendered as single/multi user picker fields. Issue security schemes can use the values in user picker fields for issue security. However, user picker 'script fields' don't show up as options when configuring security levels.

Is this a limitation of the system, and/or is there some way to make them work?

My end goal was an experiment in having a 'Database picker' custom field to select from project roles (working), and then having a pair of role member fields -- one for users (half working), one for groups (working) -- that would be used by the security scheme (not working), allowing users to make issues visible based on arbitrary combinations of project roles.

Obviously the whole idea might be a dead end if it turns out Jira can't "see" the values of those member fields early enough to determine whether the logged in user is allowed to view the issue, but I haven't gotten far enough in to find out if that dead end is waiting for me. =)

1 answer

0 votes
PD Sheehan
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.
January 30, 2020

My guess would be that the Issue Security Level screen only looks at fields based on field key/class.

Scripted fields have their own class. Whether the field is rendered as a user, group, text, number etc is only done at the HTML layer (template) and at the indexing layer (searcher).

So the screen can't know that your scripted field is a user or group field.

Plus, even if it did, there might be some other challenges since scripted fields are note stored physically in the database and depending on how the filtering of issues is done, the script may not get a chance to run before the issue is determined to be accessible by the user or not.

My suggestion would be to re-work your solution so that you have actual user/group custom fields so that you can control the security and use eventListener, postFunction or behaviours to set the values.

Suggest an answer

Log in or Sign up to answer