I'm struggling to get an automation to work correctly in JIRA Cloud. I've successfully set a trigger and gotten the lookup work items to return the expected results, but when trying to send an email with the results it fails.
The body of the email looks like the below:
The following issues are in the 'Accepted - Waiting for Deployment' status as of today:
{{#lookupissues}}
{{/}}
When I remove the smart value references the email successfully sends but it fails every time I actually try to reference the results from the second step of the automation.
Any ideas?
You appear to be using the newer, Send Customized Email action. When using a longer smart value expression to iterate over {{lookupIssues}} results, remember to first type three accent quotes ``` to enter the Smart Values Code Snippet mode in the content field. Otherwise, the expression will not process correctly.
Kind regards,
Bill
@Bill Sheboy This worked, thank you!
As a follow-up, could you point me to any good instructions on combining the smart values code and HTML if you know of any?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped! Please consider marking this question as "answered" to help others with a similar need find solutions faster.
For smart values and HTML, particularly in the new Send Customized Email action, I recommend:
To save you time, some things just do not work with the new action and some macros. For example, when using the Table macro with smart values, if a smart value expression evaluates to null / empty, the conversion to HTML behind the scenes will fail with the curious error message:
Invalid value provided for the required field: body
The workaround for that defect is to use a conditional expression in the table cell so the macro never gets an empty value. For example:
{{if(exists(issue.customfield_12345), issue.customfield_12345, "EMPTY")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It might just be a copy-and-paste error, but I believe lookupIssues is case-specific.
If that's not it, can you provide a screenshot of your automation rule and what you're getting in the audit log when it fails?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Chris Rogers ,
I double checked and it stills fails with matching case. See the automation workflow, email body, and error below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Christopher Danner
Change the format to PlainText and use this:
The following issues are in the status 'Accepted - Waiting for Deployment':
{{#lookupIssues}}
• {{key}}: {{summary}}
{{/lookupIssues}}
Hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.