Behaviors Script - Read only field dependant on group

Deleted user December 7, 2015

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

Adam

1 answer

1 vote
Jeff Louwerse
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.
December 7, 2015

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.

 

 

JessicaB October 17, 2016

@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
TAGS
AUG Leaders

Atlassian Community Events