Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

hide/show fields depending on a users permissions

I'd like to hide fields depending on permissions.  For example, I want to only Admins and my manager group users to be able to see a specific field in the EDIT screen.  

I want to hide it from users that are not admins or managers.  

3 answers

1 accepted

1 vote
Answer accepted

Hi Wanda,

You'll need a 3rd party addon to achieve this. Something like Secure Fields for Jira or Field Security Plugin for Jira.

I see.  Can i just remove it from the Edit screen and add it to the Workflow screen? 

I've also having a hard time adding it to the Workflow screen...

Like Heather R likes this

I suppose you can remove these fields from the Edit screen, which will prevent ANYONE from editing their values. 

After that create a separate screen and add your fields to it. Then create a workflow transition from a status and make it point right back to that status. Attach the screen you have created to this transition and also add a condition that would allow only members of a certain user group/project role to trigger it. This way those users will be able to set/edit your field values by triggering this transition but only as long as the issue is in that status. For other statuses you'll have to create separate similar transitions.

Naturally this can turn into a maintenance nightmare very quickly, especially if you have many complex workflows with a lot of statuses, so I strongly advise NOT to use this method, unless you absolutely have to.

Like # people like this

Thank you so much!  I will heed caution.  For now, until they allow me to purchase addons, I removed it, added a new screen, and added it to a part of the workflow where only managers have permission to access.  

 

thank you again for your help and prompt response. 

But even the user is not in that specific role and can't see the transition, he can see the field-changes in the issues activity-tab!

0 votes

If you are using the cloud version of Jira, Field Level Permission Apps for Jira Cloud are available.

Hide fields or make fields read-only based on user, group, project role, and so on.

(Please note that I'm one of the folks behind Ricksoft that is the vendor of one of the apps.)

If you are using data center version of JIRA, behavior scripts could be a solution.

Add below in Initialiser of ScriptRunner behavior setting:

import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FormField

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
FormField fieldYouWantShowToCertainUser = getFieldById("fieldIdYouWant")

if ( currentUser != "userYouWantFieldShowTo") {

fieldYouWantShowToCertainUser.setHidden(true)

}

@Alex Cheng 

I have tried an alternative script which works but.
When the field is filled with data it is visible to all users.

How can i hide it from View screen ? any java script i can use?

Like Manali Butey likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you