Automation Email - Trying to hide a line in my table if the custom field is empty

Suzi Firth
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.
February 25, 2025

SOS!! I've tried everything under the sun to get this to work to no avail.

I have a beautifully crafted email that sends to the approver with all the fields from the completed form so they can approve from the email without going into the Jira Portal. Green tick, amazing, the crowd goes wild.

I'd like to take this a step further by hiding lines from the table when they are blank/empty (not required for this particular request). Some custom fields are simple text, date, checkbox, dropdown single select.

I tried to add the code line {{#if issue.customfield_10247}} but this ends up hiding the line regardless of whether there is a value in it or not.

Here is an example of one of my tables. For example the requestor may only need flights and accommodation but not car hire. So the car hire field would be empty and would like to hide:

Screenshot 2025-02-26 115020.png

Screenshot 2025-02-26 115219.png

Thanks

1 answer

1 accepted

3 votes
Answer accepted
Vishal Biyani
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.
February 25, 2025

@Suzi Firth 

Can you try with exists?

e.g. if customfield_10272 does not have a value, then content inside if block won't be printed.

 

{{#if(exists(triggerIssue.customfield_10272))}}
Value: {{triggerIssue.key}} {{triggerIssue.customfield_10272}}
{{/}}

 

Let me know if this works for you.

Suzi Firth
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.
February 25, 2025

It didn't work - the line was missing even when the field had a value....but even more interestingly, it hide the text when I had the wrong custom field mentioned.

I copied and pasted from your response but didn't update to the appropriate field to what I needed.

Suzi Firth
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.
February 25, 2025

Actually, I updated to my custom field ID and it works! Your amazing thank you so much!

Like Vishal Biyani likes this

Suggest an answer

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

Atlassian Community Events