Hi Team,
When I create an automation to send the email to show Jira report, I'm encountering one problem. I want to include two parts in one email. The first part is to show a list of jira whose fixVersion is not empty; and empty fixVersion Jira list in second part. When I try to use below condition to split two parts, I cannot get what expected. Even the field is empty, it cannot return True.
{{#if(equal(issue.fixVersions,null))}}
{{#if(equal(issue.fixVersions,""))}}
{{#if(equal(issue.fixVersions,invalid reference))}}
Could you please give any suggestion here? Thanks!!
The question was about including two parts in an email sent by a Jira automation rule: one part for Jira issues with a non-empty fixVersion field, and another for issues where fixVersion is empty. The issue encountered was that the conditions used to split the two parts didn't work as expected, and even when the fixVersion field was empty, it didn't return true.
The conditions tried were:
The solution involves using the right smart value syntax to check if a field is empty or not. Jira Automation smart values can be tricky, especially when dealing with fields that can have multiple values like fixVersions.
Here's how to approach it:
Check if fixVersions is empty: To accurately check if fixVersions is empty, you can use the .isEmpty() method. This method is specifically designed to handle cases where a field may not have any value.
{{#if(issue.fixVersions.isEmpty)}}
// Actions to perform if fixVersions is empty
{{else}}
// Actions to perform if fixVersions is not empty
{{/if}}
Ensure the field name is correct: Double-check the field name fixVersions. In Jira, field names are case-sensitive and must match exactly.
Additional checks for null or undefined values: The methods tried (equal(issue.fixVersions,null), equal(issue.fixVersions,""), and equal(issue.fixVersions,invalid reference)) are not the recommended approach for checking if a list-type field like fixVersions is empty.
By using the .isEmpty() method, the automation rule should correctly execute actions based on whether the fixVersions field is empty or contains values.
Hi wkennedy,
This works for issue.fixVersions. However, if I apply this to inwardIssue's fixVersions, it doesn't work. When I use {{inwardIssue.fixVersions.name}}, it return an empty set [], how to verify inwarIssue's fixversion is empty? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's an approach to try:
{{#if(inwardIssue.fixVersions.isEmpty)}}
// Actions to perform if inwardIssue's fixVersions is empty
{{else}}
// Actions to perform if inwardIssue's fixVersions is not empty
{{/if}}
If the .isEmpty() method does not behave as expected with inwardIssue, consider the following troubleshooting steps:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Nicole Wang
For the linked issues, you can only get, key, summary, status, priority, issuetype available but not fixversion, so it will return empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi wkennedy/Sattaluri,
{{inwardIssue.fixVersions.name}} can return concrete thing if version is not empty. But I'm confused that when I apply isEmpty to it, it return empty rather than true/false.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh wow, never realized we coudl access linkedissues fix version.
Please check like below..
{{#if(issuelinks.inwardIssue.fixVersions.name.isEmpty)}}true{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.