Hi!
Our automation is looking at the comments to see if there is anything like ##TESTING123 and making that into a label (I have a regex match for ##). I strip off the ## and create a label called "TESTING123". Works good.
The issue i have is when there is more than one regex match (ie someone enters a comment like this "Here is a comment that contains ##TESTING123 and ##TESTING124"). I'm trying to use a smart value that contains all matches and then I want to iterate them and put them in to the issue JSON label group as such:
{
"fields": {
"labels": [
"{{labelNames}}"
],
}
}
My smart label name is labelNames - which, according to the logs, looks like this: TESTING123, TESTING124
Unfortunately, this doesn't work. I think it's because there needs to be double quotes around each value when iterating and a comma after each iteration except the last one for it to be proper JSON.
Can anyone help me out?
Hi @Ryan Markle
To achieve the behaviour you want, you would need to iterate (branch) over the smart value.
Unfortunately, this is not currently supported. There's an open feature request for this: https://codebarrel.atlassian.net/browse/AUT-2023.
Eric
For future reference, I was able to add(not update) multiple labels using the following json:
{
"fields": {
"labels": {{issue.summary.match("##(\w+)\b").asJsonStringArray}}
}
}
For some reason it didn't like me using a variable I created so I had to use the field directly
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.