Forums

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

Field Level Security Options

Mike
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.
August 22, 2019

I am looking at options to ensure users cannot add components to issues in a jira project unless they are in a specific group. I know field security is not supported by Atlassian, but curious if anyone has utilized script runner to do this. I didnt know if anyone had been able to clear a field unless part of a group or something similar.

Users cannot add component (or the component is cleared during transition)

Users in specific group can add component (component is not cleared during transition)

Reading into this: https://community.atlassian.com/t5/Answers-Developer-Questions/Possibility-to-restrict-certain-Custom-Field-based-on-users/qaq-p/465663

But does not look like it will work on standard field like components. 

I am on jira 7.x server. Thanks

1 answer

1 vote
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.
August 23, 2019

Yes, ScriptRunner Behaviours can help you with that.

Here is a sample scriptrunner behavior script that will restrict the list to only show the top 3 components. Just add the logic to get the current user's group and map that against a pre-set list of allowed components

import com.atlassian.jira.component.ComponentAccessor
def fld = getFieldById('components')
def pcm = ComponentAccessor.projectComponentManager
def allComponents = pcm.findAllForProject(issueContext.projectId)
def firstThreeAsMap = allComponents.take(3).collectEntries{[(it.id):it.name]}
fld.setFieldOptions(components)

Suggest an answer

Log in or Sign up to answer