How to evaluate if an issue has links inside an email automation

Tom Scoggin
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.
January 13, 2025

I've been trying to evaluate if the current ticket has any values in the issue.issuelinks field and just can't seem to get it to evaluate to True. I've tried:

  • {{(#if (issue.issuelinks))}}
  • {{(#if (issue.issuelinks.isNotEmpty()))}}
  • {{#if (issue.issuelinks.outwardIssue.value.isNotEmpty())}}

If I add {{issue.issuelinks.outwardIssue.key}} directly into my email template it prints the two linked issues keys. As a work around I put the {{issue.issuelinks.outwardIssue.key}} value in a variable and then evaluated to see if that variable was empty and it works. I was just hoping to have a more direct way.

Thanks for the assistance.

1 answer

1 accepted

0 votes
Answer accepted
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.
January 13, 2025

Hi @Tom Scoggin 

Checking for empty (or blank) fields within rules is challenging and depends upon both the field type...and for some fields whether or not they ever had a value (and were later cleared).

For a list field such as {{issue.issuelinks}} please try using the size function with a condition on the math function gt() for greater than 0:

{{#if(issue.issuelinks.size.gt(0))}}there are links!{{/}}

 

Kind regards,
Bill

Tom Scoggin
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.
January 13, 2025

Thanks Bill. I was able to use it for Labels and Components as well. 

Suggest an answer

Log in or Sign up to answer