ScriptRunner for Jira - Field is not locking

I am trying to lock a field so a specific group cannot edit the value.

Below is the setting I have configured but the Group is still able to edit the Issue Type field. What should I change so this field is locked?

unnamed.png

1 answer

It seems to work when testing on my end. Can you also send a screenshot of your current Mappings and ensure that the projects and issue-types that you are wanting this to apply to are mapped to the behaviour?

 Here are a few screenshots of my settings. The plug in works for some fields (ie: Priority & Issue Status) but not all (ie: Issue Type & Labels).

For the Mapping, All Projects is selected.

A.PNGB.PNGC.PNGD.PNG

A few thoughts:

Your first condition seems to read "Issue type should be read-only when the current user is in the Hopkins CTE group." Same thing for priority in the later screenshot. What group is able to edit the field that you would expect to be unable to? Is it Hopkins CTE, or are your expecting something else?

On some screens, it makes sense that it wouldn't work for Issue Type, since Behaviours require a project / issue type combination in their definition. Now, you should be able to make issue type read only if you're on the regular edit screen, but the first screen where you choose product and issue type won't fire behaviours, I don't think. On the subsequent screen (the full create/edit view), you should be able to make the issue type read only, though.

In your screenshot of the behaviour's mapping, it looks like you don't have a project selected. You need to select at least one, or select "All" if this is for all projects.

Also, be aware of the known limitations of behaviours. Two may be germane in your case:

  1. If network latency is a factor, you may see some delay before a behaviour is applied.
  2. Multiple behaviours are not allowed on the same field. If you have more than one behaviour in overlapping contexts that affects the same field, only one will fire. Since your behaviour seems to be mapped to all projects and all issue types, that may be your problem.

 

Also, there are some known limits for the label field:

https://productsupport.adaptavist.com/browse/SRJIRA-1080

If you're trying to set a default value, this won't work in the current release (5.0.1).

What group is able to edit the field that you would expect to be unable to? Is it Hopkins CTE, or are your expecting something else?
Hopkins CTE is able to edit the field, but they should not be allowed to do so.

On some screens, it makes sense that it wouldn't work for Issue Type, since Behaviours require a project / issue type combination in their definition.
Can it be made read-only when on the View Issue screen?

In your screenshot of the behaviour's mapping, it looks like you don't have a project selected. You need to select at least one, or select "All" if this is for all projects.
Sorry, when I did my screenshot of the mapping nothing was showing as selected, but a project was selected.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,111 views 13 19
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot