Behaviors Script - Read only field dependant on group

Good Morning

We have a field that we want to make read only for certain users.

Looking at the Behaviours plugin, the documentation says that using the plugin can help to "Making a field read-only dependent on user role or group".

Can you please help me to do this?

I have got the following to put in the script area for the selected field: "formField.setReadOnly(true)" but do not know how to only apply this to only to people in certain group/s or to those that are not in a particular group.

I hope to hear from someone soon on this.

Kind regards


1 answer

assuming you are not doing anything else, You really don't need to add any script for this.. You should see something like this when editing the behaviour.

Required (Optional)
Writable (Readonly)
Shown (Hide)

Conditions: None - Add one.

Just select the "readonly" option (it is a hyper link in you instance)  and then under Conditions.. add the proper except or When condition you want.  Once in the conditions part it should be self explanatory.. just remember to select the proper Except or When.. I always get caught on that one and put the wrong one in.



@Jeff Louwerse or @Jamie Echlin (Adaptavist) - how do you make it stay read only after the form has been submitted. I have the issue that when the create dialog first launches it adheres to the Readonly change I made, but if there are any errors on the page it flips it back to writable which defeats the purpose of creating the behaviour. Any ideas would be great or if there is something additional I'm supposed to be doing? Do I need to create a validation script?

We are running JIRA Server version 7.1.2 and Scriptrunner 4.3.5

Maybe it has something to do with the following reported issue i found: https://productsupport.adaptav...

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

819 views 3 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you