Field with Multiple Conditions

Barry Smyth
Contributor
May 13, 2024

 

Can I have multiple conditions on a field. For example

CONDITION 01

if the field is empty change the value to "No".

CONDITION 02

Only allow certain users to change the value to "YES" For this condition what would the code be? 

hasChanged(FIELD):true AND FIELD:2 AND USER = 01 OR USER = 02 etc.

Do I put the conditions in their own rule (ie two rule fields) or do I have to set both conditions in the same rule separated by a ; or something?

 

1 answer

0 votes
Ben Finn
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.
May 13, 2024

If you do it during a transition then you can use workflow conditions and a post function . I would set up a group and add users to that group, then use the User is in Group Condition. 

image.png

Otherwise, you will need to use automation let me know and I can provide more details.

Ben Finn
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.
May 13, 2024

I just noticed you posted this in Confluence. Could you give some more details about the field changes you are talking about.

Barry Smyth
Contributor
May 13, 2024

Creating a group is out of the question, there's so much red-tape around that internally that it would take weeks to setup assuming it got approved. 

The first condition is easy, I already have it as a rule on the field. Basically it tests if the field is empty and is so defaults to a chosen value. So no issues there.

The 2nd condition needs some thought. It needs to be something like

Field change = True AND

Field Value !=01 (i.e. not equal to the first field value) AND

USER_ID = 123456 OR 234567 OR (etc.)

In other words the condition means only certain people are allowed to change the value of the field to anything other than 01

 

Barry Smyth
Contributor
May 13, 2024

So I think this is the condition I need to put but it would be good if someone can verify.

hasChanged(FIELD):true AND !FIELD:[01] AND [entry._user]:123456 OR [entry._user]:654321

the condition means that only the two specified users can change the field to anything other than 01. Meanwhile everyone else can change it to 01. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events