Jira Automation smart value
asNumber in Jira Automation: syntax and examples
asNumber converts a text value to a number when the text is a number. Use it on pieces of text you cut out with other functions, such as the digits of an issue key, before you do math on them.
Syntax
{{text.asNumber}}
Works on
- Fields: any text value, for example the result of substringAfter() or split().
- Returns: a number, or an empty value when the text is not a number.
Examples
{{issue.key.substringAfter("-").asNumber}}Take the numeric part of the issue key as a number. With a work item key of WEB-44 it gives 44.
Result:
44Run on Jira Cloud on .
{{#=}}{{issue.key.substringAfter("-").asNumber}}+1{{/}}Compute the next issue number from the current key inside a math expression.
Result:
45Run on Jira Cloud on .
{{issue.key.substringAfter("-")}}The same cut without asNumber: it looks identical in a comment, but it is still text.
Result:
44Run on Jira Cloud on .
{{issue.summary.asNumber}}Check what a summary that is not a number gives: nothing.
Run on Jira Cloud on .
{{issue.summary.split(" ").first.asNumber}}Try the first word of the summary. Hello is not a number, so the result is empty.
Run on Jira Cloud on .
Where the documentation differs
{{issue.summary.asNumber}}Run on Jira Cloud, : the documentation says
Null, the actual result is.
Pitfalls
- Text that is not a number renders as an empty string, not as the word Null that the Atlassian page shows (checked on Jira Cloud, November 2026). Test for an empty result if the next step needs a number.
- Cut the number out first. The summary
Hello World!gives nothing, while the digits taken from a key withsubstringAfter("-")convert. - In a math expression the smart value goes inside
{{#=}}...{{/}}and asNumber makes sure you add numbers, not join text.
Related
- {{#=}} math expressions
- substringAfter(), substringBefore(), substringBetween()
- split()
- isAlpha(), isAlphanumeric(), isNumeric()
- gt(), gte(), eq(), lt(), lte()