Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting input from a custom field

Akinola Oke
June 8, 2026

I have a custom field which contain both text and number in this form "sehr unwarsch., 1", however I would want to extract the number at the end and populate it into another custom field.

What argument would be appropriate in this case? Should the custom field name be used instead of the customfield number.

Would this be appropriate {{issue.customfield_12200.substringAfter(",").trim()}} as I am not getting the expected result.

Or is it more appropriate to use the custom-field name itself.

 

4 answers

1 accepted

3 votes
Answer accepted
Paul Glantschnig _Appfire_
Atlassian Partner
June 9, 2026

Hi @Akinola Oke,

Referencing the field by its ID (customfield_12200) is IMO the most reliable approach, so syntax should be fine.

When nothing comes through, the cause is usually the field type:

  • Is the source a single-select / dropdown field? Those don't return a plain string, they return an option object, so the text functions have nothing to work on. Reach the text through .value first: {{issue.customfield_12200.value.substringAfter(",").trim()}}
  • Check the destination field. Writing into a number field stores 1 fine; if it's another select field, the option 1 has to already exist or the value is silently dropped.

The quickest way to diagnose: add a temporary Log action that prints both {{issue.customfield_12200}} and {{issue.customfield_12200.value}}, run the rule, and read the audit log. That shows you exactly which form holds your text, and you can plug that into the extract.

Best, Paul

Paul Glantschnig _Appfire_
Atlassian Partner
June 9, 2026

Following up on the field-type angle, @Akinola Oke: it's worth asking why the number needs to live in a separate field. If you mainly want to report on it, group by it, or just see it, you may not need a rule at all.

If you're open to an app from the Atlassian Marketplace, JXL (the app my team and I work on) lets you add a formula column that derives the number live, with no automation to maintain. For a value like "sehr unwarsch., 1" the formula could be e.g.:

Number(this.customfield_12200.split(",").at(-1))

The column recalculates whenever the source changes, so it stays in sync on its own.

If you specifically need the number written back into a real Jira field for JQL or other rules, the automation route is still the right tool.

Cheers, Paul

Akinola Oke
June 9, 2026

Thanks Paul, the ".value" was the missing point.
The fields are "dropdown field" and need for further mathematical calculation.

All is working fine now.

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 8, 2026

Hi @Akinola Oke -- Welcome to the Atlassian Community!

When you describe not getting the expected result, what do observe happening?

Perhaps if you post images of the following, those will provide more context for the community to help:

  • an image of the complete rule in a single image for continuity
  • an image of the rule action where that smart value expression to extract the value is used
  • an image of the audit log details showing the rule execution
  • and, what is the type of the destination field into which you want the number stored?

 

Kind regards,
Bill

0 votes
Sam Okell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 8, 2026

A much simpler way:

 

{{issue.customfield_12200.right(1)}}

 

It'll just give the last character.

You could also add a check, in case the last character is a space, which if it is then this should work:

{{issue.customfield_12200.right(2).left(1)}}

0 votes
Florian Bonniec
Community Champion
June 8, 2026

Hi @Akinola Oke 

 

Have you try {{issue.customfield_XXXXX.split(", ").last}} ?

You can use the field ID in that case.

Regards

Suggest an answer

Log in or Sign up to answer