Hello, I am using the following smart value to capture the word that comes after Fiscalizador: {{issue.description.match("Fiscalizador: (.+)")}}, the funny thing is that if I "paste" that smart value in a Text Field (single line) Jira interprets it as a kind of color (Clarify that Fiscalizador: will always have a number after it, ex: Fiscalizador: 12389). And if I paste this in the comments it simply pastes the number of this value. In summary If we take as an example the case of Fiscalizador: 1234 In a Text Field (single line) format field it will tell me 1234{color} In the comments it will show me 1234 I need to know if I am doing something wrong or if it is something specific to Jira. My intention is that only 1234 appears (it only happens to me with numbers
Assuming the text you need is in a custom field called Description
, and you want to capture what follows "Fiscalizador:":
{{issue.Description.split("Fiscalizador:").last.split(" ")[0]}}
This splits the description text by "Fiscalizador:", then takes the last part of that split result and further splits it by spaces, capturing the first word.
If you want to see the result for testing, you can use the "Log action" to output the captured value.
The captured value is: {{issue.Description.split("Fiscalizador:").last.split(" ")[0]}}
Or you might use this value to populate another field or take some other action in your rule.
@Manoj Gangwar Hi, thanks for the quick response. I'm going to try what you're telling me, but I'll leave you the images associated with my problem anyway hahaha
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.
Could you please test the smart values?
{{issue.description.match("Fiscalizador: (\\d+)")}}
OR
{{issue.description.match("Fiscalizador: (\\d+)")[0]}}
this one cleans up any special characters or formatting tags before inserting the value.
{{issue.description.match("Fiscalizador: (\\d+)")[0].replace("{color}", "")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice, the first option {{issue.description.match("Fiscalizador: (\\d+)")}} is good :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Manoj Gangwar One last question, what happens in the case of words? How does the formula vary? I was looking and if I extract a phrase I still get the phrase {color}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to extract words or phrases after "Fiscalizador:", you can adjust the regular expression to allow letters, spaces, and possibly other characters.
{{issue.description.match("Fiscalizador: ([\\w\\s]+)")}}
\\w matches any word character (letters, digits, and underscores).
\\s matches spaces (to handle multiple words).
The + ensures it matches one or more of these characters.
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.