I want to include if condition in the email template of jira automation as I cannot use the normal IF operators because I had to send email like this:
Hi Person,
<if field A is not empty>
Field A
<if field B is not empty>
Field B
<if field C is not empty>
Field C
I realise if B is really empty, then it will leave a large line break in between. So i had to use if conditional logic in jira automation. Does anyone know how to incorporate the conditional logic in jira software 8.20.10?
Hello @Jar Lady
Yes. You can use conditional logic like below in your email.
{{#if(exists(issue.Field A)) }} - Field A. {{/}}
{{#if(exists(issue.Field B)) }} - Field B. {{/}}
{{#if(exists(issue.Field C)) }} - Field C. {{/}}
Now depending on the field type, you may have to do below syntax:
{{#if(equals(issue.Field A,"")) }} - Field A. {{/}} OR similar. But do try the exists logic first and log the value and let us know.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.