Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Worst Jira Admin Contest: Four Smart Value Errors in One Automation Rule

Mistake 20

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?

f8c83a70-e3bb-40da-b3a8-48291657c036.png

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.

Problems and Solutions

Why did I have so much trouble? Here’s what went wrong and how I fixed it.

Finicky Field Entry

send-email-to.png

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”.

4e36be2a-cc49-4b79-b93d-d16515cbbc6a.png

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.

f10450d9-f687-4028-b719-06bfea494ad9.png

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.

5b67c612-16e6-449f-a315-45dde6a798ac.png

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.

e2e39f20-3d7e-4334-bd17-7d43b39c028b.png

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}}

df1a6899-1490-4d1b-93fc-37e763829598.png

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!


Back to intro and mistakes list

2 comments

Sophia Do
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 5, 2024

Hey @Rachel Wright 

I'm Sophia, a Product Manager on Automation 👋

Just wanted to say thanks for sharing this - it's super valuable feedback! We're exploring all of these challenges you're facing and will keep you updated.  

If you have any other feedback, feel free to schedule a chat

Warm regards

Sophia

Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 2, 2024

HI @Rachel Wright 

Thanks for these helpful tips.

My tip is to watch out for spaces:

{{issue.Supplier Email Address}} is not the same as {{issue.Supplier Email  Address}}!

This is especially important when you get word wrap with Email on one line and Address on the next

Like Rachel Wright likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events