Jira Automation: Conditionally email date field value

Ashley Honeycutt April 17, 2024

We have an automation that sends certain details when an issue is created to relevant users. 

One of these fields is a custom date/time field, however they don't always know this date when creating the ticket. In that scenario, the email just has a blank value. 

Is there a way to show something like "TBD" if the field is left blank?

Thank you!

 

Edit: I know I can do an if/else rule with the field as a condition for which email gets sent, but I would prefer the smart value route if it's possible.

1 answer

0 votes
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 17, 2024

 

Hello @Ashley Honeycutt 

Below is how I use it in my emails:

{{#if(equals(customfield_11700.value, NULL))}} <b style ="color:red;"> TBD </b> {{/}} {{#if(not(equals(customfield_11700.value, NULL)))}} {{customfield_11700.value}} {{/}}

 

You can replace "customfield_11700.value" in above with smart value which gives you this date.. Hope it helps.

Bill Sheboy
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 17, 2024

Hi @Kalyan Sattaluri 

Did you confirm that expression works for a date field type for Server / Data Center?  I know the null handling tests can vary by field type and whether or not the field was previously cleared...at least for Jira Cloud automation that is the case.

Thanks!

Kind regards,
Bill

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 17, 2024

Hi @Bill Sheboy 

Just tested against Due Date field and NULL evaluation worked.. Hopefully will work for @Ashley Honeycutt  as well.

 

Ashley, please replace your date field with "Due date" in below syntax and share if its working. Thanks!

 

{{#if(equals(Due date, NULL))}} <b style ="color:red;"> TBD </b> {{/}} {{#if(not(equals(Due date, NULL)))}} {{Due date}} {{/}}

 

image.png

Like Bill Sheboy likes this
Ashley Honeycutt April 18, 2024

Thank you, @Kalyan Sattaluri

I feel like this approach is getting me closer to what I'm looking for, although for some reason I'm receiving "TBD" even if the date/time custom field has a value in it. 

I'll keep tinkering with it, but if anybody knows in the meantime what I may be missing, I'm all ears. 

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 18, 2024

Please share the syntax you are using so we can review.

Also, instead of trying it out in email, replicate the rule I have above, so log the values like I have, trigger it with value present in the field  and value removed and share audit log.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events