Jira Scriptrunner Behaviours: 'and' conditions

I am trying to use behaviours to restrict when a particular field is editable.


The field is called Feature Outline and it is a multi-line text field. We want to restrict it two ways:

* Only people in an admin user group are allowed to edit this field

* Those people are only allowed to edit it when the issue is in a Proposed state


This is effectively a requirements gathering ticket. The admin people are allowed to propose new projects and fill out the Feature Outline for what they want, and when they are happy they can move it to Confirmed state. When in Confirmed, engineering can respond to the requirements, and if there is a change needed, it is pushed back to Proposed.

The admins are only allowed to edit the Outline when it is in Proposed state. When it is in Confirmed or Finalised states, no-one can edit the Outline.

I figured Behaviours was the easiest way to get this working, with the Readonly attribute.

I have tried adding the following conditions but they seem to be operating in an "or" manner and not an "and" manner:
Field - Feature Outline, ReadOnly, Except:

* For workflow step Proposed

* Current user in group Admins


If I only have the first one, then I can see that it is editable only when it's in the Proposed status, but unfortunately there's no restriction on the users who can edit it. When I include the admin clause, it lets me edit the field regardless of what status it has, which is wrong.

1 answer

1 accepted

Actually I found out how to do this - you have to add another behaviour for the same mapping for that field, and put 1 of the conditions in that one. Then when the behaviours are being tested, they work together like an 'and' clause.

Pity that there's no way to just do this in a single behaviour though.

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 ...

2,816 views 11 18
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