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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,375
Community Members
 
Community Events
176
Community Groups

Call string functions on a smart value for select box

Edited

I have a select box whose values are in the format of:

"1 - stuff; more stuff; and other stuff"

I am trying to use smart values in an automation to get the 1.  This seems straight forward and I should be able to do

{{issue.Field Name.charAt(0)}}

or

{{issue.Field Name.substring(0,1)}}

However, both of these return None.  While debugging, I've found the following things return the expected result:

{{issue.Field Name}}

{{#urlEncode}}{{issue.Field Name}}{{/}}

Interestingly, these return None:

{{issue.Field Name.urlEncode}}

{{issue.Field Name.toLower()}}

My suspicion is that it is returning a non-string value an the functions are therefore failing?  How can I call string functions on select box values?

 

1 answer

Hi Rick,

It might be too late to answer this but hopefully it helps other people working with the JAP rules.

I came across today something similar that I resolved by appending the ".value" to the smart value tag. 

For example, instead of:

{{issue.Field Name.toLower()}}

Try:

{{issue.Field Name.value.toLower()}}

Also, using the custom field ID instead of the name is safer because sometimes duplicate field names exist in instances that cause the rule to fail. The custom field ID can be given to you by your system admins, or found by right-clicking with the browser inspector over the field name. In Jira Cloud, you may need to do this on the issue creation screen.

A more complex edit field payload example (captures a dropdown menu option, manipulates it and posts it to another field): 

    {
        "fields": {
            "customfield_DESTINATION_FIELD_ID":
            "{{issue.customfield_SOURCE_DROPDOWN_ID.value.substringBetween("=", "w").split("-").last.replace("+","")}}"
        }
    }

 Hope it helps someone!

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events