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,772
Community Members
 
Community Events
176
Community Groups

Trouble using data from a custom field in Jira Automation

Edited

I have a custom drop down called "delivery date flexibility" with values such as "<6 months (5)" or "<1 month (20)".
 

Using a Log Action in Jira Automation to try to find the right syntax to use I'm not seeing values as expected.

The line in my Log Action is as follows:

{{delivery date flexibility}} . {{delivery date flexibility.id}} \ {{issue.customfield_10259}} \ {{issue.customfield_10259.name}} \ {{issue.customfield_10259.displayName}} \ {{issue.delivery date flexibility}} . {{delivery date flexibility.displayName}} . {{delivery date flexibility.name}} . {{delivery date flexibility.length()}} . {{delivery date flexibility.replaceAll("(\D)","")}} . {{delivery date flexibility.match("(\d)")}}

This returns:

<2 months (13) . 10259 \ \ \ \ <2 months (13) . . . . . 

 

So, these work as expected, so I've got the field name right:

{{delivery date flexibility}} returns the expected value "<2 months (13)"

{{issue.delivery date flexibility}} returns the expected value "<2 months (13)"

{{delivery date flexibility.id}} returns the expected field ID "10259"

 

These don't work and I expected that they would. Where am I going wrong with these? Ultimately I want to just extract the digits in the braces from the string, e.g. "13" to use in a formula.

{{issue.customfield_10259}} returns null.  I expected "<2 months (13)". Adding .name or .displayName also returned null

{{delivery date flexibility.length()}} returns null. I expected "14"

{{delivery date flexibility.replaceAll("(\D)","")}} returns null. I expected "213"

{{delivery date flexibility.match("(\d)")}} returns null. I expected "213"

1 answer

1 accepted

0 votes
Answer accepted

Fooling around trying to find Using .value is mentioned in the customfield smart value doco, but only in passing.

It would have been nice if it were given it's own section heading as it's critical for getting the value out. That said:

  • {{issue.customfield_10259.value}} still returned null
  • {{delivery date flexibility.value.length()}} returned 14
  • {{delivery date flexibility.value.replaceAll("(\D)","")}} returned 213

At the risk of giving myself an internet point. I'm answering my own question as I thought this info might also help someone else one day. 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events