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

Trouble using data from a custom field in Jira Automation

Dave F June 30, 2022

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

1 vote
Answer accepted
Dave F June 30, 2022

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
AUG Leaders

Atlassian Community Events