One day I was building a Jira Cloud automation rule to show an example of using smart values in one of my Jira courses. The purpose of the rule was to send an email to an external user when an issue reached a certain step in a workflow. The external user’s email address was stored in a custom text field. I built the rule using the send email action. Then I used smart values, which are placeholders, to insert the “send to” address and custom information in the message. Pretty simple, right?
Jira Cloud automation audit log
As the audit log shows, it took me a while to get the message working exactly the way I wanted. Just look at all those config change and error records! I definitely had trouble with some of the smart values.
Why did I have so much trouble? Here’s what went wrong and how I fixed it.
Finicky Field Entry
Smart value in the “To” field in the “Send email” action
My first challenge was a user interface issue. The “To” field for the send email action is both a text entry field and a drop down list. I find that sometimes when I type a smart value, it doesn’t stay in the field. Be sure to type the “enter” key after entering the smart value. You’ll know it’s entered correctly if the text has a grey background like in the screenshot.
ID10T Error
ID-10-T is also known as a user error. The combination of the characters spells the word “idiot”.
Audit log error message
Next, I was not receiving the email message and the audit log was showing the error pictured. First, I double checked that the field wasn’t empty and had a correctly formatted email address.
A custom text field called “Supplier Email Addresses” in a Jira issue
After staring at the field for 5 minutes, I realized the problem was user error. The custom field name was plural! I named the custom field “Supplier Email Addresses” with the intent of potentially collecting multiple email addresses.
Tip: The send email automation action supports multiple addresses if they are separated by commas.
My miss-typed custom field name was the cause of the problem.
NO → {{issue.Supplier Email Address}}
YES → {{issue.Supplier Email Addresses}}
YES → {{issue.customfield_10121}}
I needed to correct the spelling or use the custom field’s ID in the format shown. I decided to use the ID which is less error prone and won’t break if the custom field name changes in the future.
Multiple Custom Fields with the Same Name
With the “To” address fixed, I was finally receiving an email message. My automation rule also posted a comment, so the user would know what information was sent to the supplier. Here's an example.
Missing “Approx. Cost” value in Jira comment
I noticed that the smart value for the approximate cost wasn’t coming through in the comment or in the email. So of course, I started by checking for typos. Luckily this time, there wasn’t a spelling issue.
Two custom fields with the same name
Next, I checked the custom fields admin page and bingo – I found the problem! There are two custom fields named “Cost”. Yuck – who’s Jira application is this anyway? Since there are two fields with the same name, Jira doesn’t know which to use. The fix is to use the custom field’s ID instead of its name.
Custom Field is the Wrong Type
Finally, I wanted the approximate cost field to be shown as currency but couldn’t get the built-in “as currency” smart value format to work. E.g., {{issue.customfield_10252.asCurrency}}
Number field created as text type
Unfortunately, the “Cost” field in this Jira project was a text field instead of a number field. Yuck again! Since I couldn’t use the “as currency” function, and all amounts are expressed in US dollars, the easiest workaround was to hard code a dollar sign before the smart value.
NO → {{issue.customfield_10252.asCurrency}}
YES → ${{issue.customfield_10252}}
I definitely spent too much time on this “should have been easy” automation rule! At least I thoroughly tested it, the audit log highlighted many of the problems, and after all the fixes it works as designed. Now I can get back to Jira course creation and you can avoid similar smart value mistakes!
Rachel Wright
Author, Jira Strategy Admin Workbook
Industry Templates, LLC
Traveling the USA in an RV
46 accepted answers
2 comments