I want to isolate a number from a text for automation.
I tried match, split and replace functions but not working.
Someone can help ?
Hi @Regis MAHOUKOU and Welcome to Atlassian Community!
It's easy to do with a Regex expression.
For example, I have a description with the current value:
And I have the following automation:
After execution, I'll get:
I recommend you this site Pattern class and this article rules documentation around regular expressions
If you encounter any difficulties, feel free to ask me, and I'll do my best to help.
Thank so much @Sergei Troshin
I've successfully tested your example.
The issue I have : "Effort" field contains a textd "3 Medium" that need to be isolated.
The functions replaceAll, split or match are not working on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Regis MAHOUKOU
1) Do you have a text field named "Effort"? Or what is the field type?
2) Do you need to extract "3" from the value "3 Medium"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep Effort is text field conatining this "3 Medium". I want to catch the number 3 so I can use it for calculation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Regis MAHOUKOU again!
It works:
{{#=}}{{issue.customfield_10058.replaceAll("[a-zA-Z]","")}} * 2{{/}}
I successfully removed all letters, multiplied the result, and put it into a Number Field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Regis MAHOUKOU can you provide an example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the Regex functions activated by default for Automation in JIRA ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.