Hey there,
I'm writing a Jira Automation Rule that is making a web request to gitlab. In the next step of the rule, I am trying to perform a regex match on the data using a pattern which needs to contain the value of another string variable I saved earlier. I want to save the matching string to a new variable I can use later.
Save the result of this regex match to a new variable:
{{apiData.match("(id=\d+[\w ,\n/\-.=]*?path_with_namespace={{myJiraSmartValue}})")}}
When I try this though, I get back the below error:
Error rendering smart-values when executing this rule:Failed to get value for apiData.match("(id=\d+[\w ,\n/\-.=]*?path_with_namespace={{myJiraSmartValue: {{apiData.match("(id=\d+[\w ,\n/\-.=]*?path_with_namespace={{myJiraSmartValue}})")}}
It looks like my syntax is incorrect when I do the above, the first pair of closing braces }} causes the evaluation of the whole expression to short circuit.
To get around the above, I tries saving the entire regex to a new smart value variable called myRegexPattern like so:
{{"(id=\d+[\w ,\n/\-.=]*?path_with_namespace=myJiraSmartValue}"}}
Finally, when I try to perform the regex match by passing in the myRegexPattern variable, I get back zero results:
{{apiData.match(myRegexPattern)}}
I KNOW that my regex pattern is correct because I've tested this scenario by replacing the variable with a hard-coded value. I can't just do this though because I won't always know what the value of the variable is... which is why I am using the variable in the first place! Does anyone know how I can pass in a variable to the regex string match function??
Thank You