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

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

64 views 1 0
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