Remove text and get only some strings using automation

Aaron Pavez _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 14, 2025

Hi Everyone!

Ive been trying to do this using automation. I'm able to remove only one set of IDs from the field. I have issues removing all the others.

This is the custom field value:

[5005e00000WW2BuAAL|https://urlhere/5005e00000WW2BuAAL ], [5005e00000WU4YGAA1|https://urlhere/5005e00000WU4YGAA1 ], [5005e00000WU1fGAAT|https://urlhere/5005e00000WU1fGAAT ]

I want to remove everything else and keep the IDs before the first square bracket and the pipe.

I want to have this in another field:

5005e00000WW2BuAAL,5005e00000WU4YGAA1,5005e00000WU1fGAAT

With remove, replace, substring I can remove the first one. Im not able to remove the other two Ids, or three or four.

but this field can change, I can add more, delete some. So the automation should be able to capture IDs (which might not start with 5005. I haven't tried using that approach though)

Any help is appreciated!

Regards

Aaron

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2025

Hi @Aaron Pavez _ServiceRocket_ 

The custom field appears to contain a list of links, with a comma delimiter.  Is that correct?

If so you could use the list and text functions to help parse the data:

For example:

{{issue.myCustomField.split(",").trim().substringBetween("[", "|").join(",")}}

Kind regards,
Bill

Aaron Pavez _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 14, 2025

Hi!

That's what I thought. I have to do several things with the same string. But I didn't know how to combine the functions. 

and yes they are links. When I save them to a variable you see them like I posted.

Let me test it and I'll be right back my hero!!

Regards

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
January 14, 2025

Hi @Aaron Pavez _ServiceRocket_ 

The links require a SalesForce login. Can you update your post with links that can be accessed anonymously?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events