Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation to check if a field was previously empty

David Washburn April 19, 2024

Is there a way using Jira Automation to check if a field was previously empty? For example we have a date field and we'd like to run an automation only when the date field was empty and is now having a value added.

I tried using the Field value changed trigger but it counts "value added" as any time the field is edited, even if a value was present before. I only want the rule to run if the field was previously empty. Is there not a way to determine this via automation?

I know I could create a complex setup with a label or something and then reference the label, but that seems like a lame workaround. I was hoping the trigger itself should be able to check if the field was previously null?

 

The rule: if Deployed to QA date field is not empty, and a value has been added, then transition the issue. If the field already has a value, do nothing. 

1 answer

1 accepted

2 votes
Answer accepted
Kalyan Sattaluri
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.
April 19, 2024

Hello @David Washburn 

 

You could use {{fieldChange.fromString}} & {{fieldChange.toString}} to check if field was previously populated or not.

Below is a screenshot of Data center and cloud will look different but basic steps are the same.

  • Trigger = Field Change, choose "Deployed to QA"
  • If Condition -> smart values check:
    • {{fieldChange.fromString}}
    • equals
    • (leave empty)
  • If Condition -< smart values check:
    • {{fieldChange.toString}}
    • does not equals
    • (leave empty)
  • Do your steps.

image.png

David Washburn April 19, 2024

Brilliant, I'll give that a test. I didn't realize the previous value would be accessible via a smart value.

Like Kalyan Sattaluri likes this
David Washburn April 19, 2024

Last question on this one @Kalyan Sattaluri. Is it possible to determine if an issue is capable of transitioning to a specific status via smart values? With this rule I'd like to use an If condition to only take an action if the issue type has a status "Development" available. Not all issues share the same workflow so the rule will error out on issues that are incapable of transitioning to the Development status, so I want to just bypass them altogether.

Kalyan Sattaluri
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.
April 19, 2024

Determining if an issue can transition to this other one gets complex. May have to make an API call and even then, I havent looked in to it to definitively say.

OTOH, If you know which issues have this status as valid, you can do another If condition -> Issue Fields Condition - Field = Issue Type and select all these issue types you know can transition.. I think this gets you close. There can only be so many of these types..

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events