Hello,
I'm jumping through the hoops necessary to export a list from a custom field, since custom field values aren't supported with #lookupissues. We have a field called Components Global that we use to store components across our whole Jira instance as we don't want to have to keep them synced between projects. I'm trying to print a list of all field values for Components Global within my queried tickets, scrubbed of duplicates.
My automation looks like this:
WHEN: Manual trigger
THEN: Lookup issues
AND: Create variable -
- Variable Name: complist
- Smart value: {{lookupIssues.customfield_10297}}
And: Create variable -
- Variable Name: complistdistinct
- Smart value: {{complist.split(",").distinct}}
And: Send Slack message
This does work, but because this field is custom and I can't use ".name" or ".value" with it, I get everything Jira has to offer for each entry. They look like this:
[CustomfieldOption{self='https://[myorg].atlassian.net/rest/api/2/customFieldOption/10595', id=10595, value='AddressMonitoringAML'}],
What I want to keep in this instance is the "AddressMonitoringAML".
I've had to make do with several .remove() instances. The part that's really tripping me up is the URL and the id=##### portion. I don't want to remove every instance of every number from the results as there are some numbers that are part of a valid response. So, I'm trying to do something like:
.remove("https://[myorg].atlassian.net/rest/api/2/customFieldOption/#####")
I've tried using regex, stuff like \d{5}, to no avail. I've tried "...FieldOption/([0-9]{5})" and several permutations of that. Nothing seems to work.
Is there a character or string I can use to represent *any character* that I can use here??
If I could remove all numbers I'd use .replaceAll() but that's not valid here.
The answer is probably really simple and I'm gonna be upset when I find out, lol
Thanks!!