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

JQL expression to extract numeric value from a single select dropdown field

Trevor Overstreet
Contributor
November 9, 2023

Hello All!

In Jira automation I'd like to extract the numeric value from a single dropdown and load into a a number field.

Example client single select list:

Client XYZ | 1234

Client ABC | 5678

*I need the numeric value after the pipe "|" so 1234 or 5678 in above example

 

Current attempted JQL: 

{{issue.fields.customfield_123.substringAfter("|")}}

OR

{{issue.fields.customfield_123.match(/\d+/)}}

Neither of which worked

Screenshot 2023-11-09 at 10.25.12 AM.png

Screenshot 2023-11-09 at 10.25.19 AM.png

2 answers

1 accepted

1 vote
Answer accepted
Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2023

Hi @Trevor Overstreet,

Use ".value" to get values from your select list, please refer to Examples of using smart values with lists. Here's the example to add into the Edit issue action:

{{issue.fields.customfield_123.value.substringAfter("|")}}

 Hope it helps.

Trevor Overstreet
Contributor
November 9, 2023

That did the trick! Thank you

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2023

Hello @Trevor Overstreet 

In what way exactly is it not working?

Have you added Log actions to your rule to print out the values of the smart value and the values you get when you add the substringAfter and match functions?

Try printing those values to your execution log to confirm that you are first referencing the field correctly and getting the value you expect before you try to apply the functions to parse it.

Trevor Overstreet
Contributor
November 9, 2023

Thank you for the response. The above jql worked

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events