I am trying to get multiple results from a regex match and make use of those multiple results. So, let's say my input string is:
[{type=Group, value=5bf99101-2825-4cd4-b14b-90e5f611045e, display=Group1, $ref=https://api.atlassian.com/scim/directory/493514aa-110a-47d3-8543-f2bb06c28954/Groups/5bf99101-2825-4cd4-b14b-90e5f611045e}, {type=Group2, value=4, display=GroupName2, $ref=https://api.atlassian.com/scim/directory/493514aa-/Groups/4]
I want to match on the value after "display=" and when I use a regex like :
{{GroupsString.match(".*?display=(.*?), .*?")}}
it seemingly correctly populates my variable "Matches", which prints out as :
Group1, GroupName2
However, my variable Matches does return any values for list expressions like, 'first', 'size', get(0) etc.
According to
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/ match() it says " If multiple matches are found, they return as a collection that can be iterated." but, as mentioned above, I cannot iterate this "collection" as a smart values list.
Any ideas?
Thanks in Advance
Same problem. I can see the collection by logging the smart value, but there seems to be no proper way to actually index into it. Some one suggested splitting the collection on commas, but that did not seem to help either.
I have had some luck saving the results of the match into a Object field by surrounding the results with double quotes i.e. using above example, make it "{{GroupsString.match(".*?display=(.*?), .*?")}}"
The Split function is not great but maybe this iteration helps your use-case
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.