How to remove spaces from {{lookupIssues}} list?

Carolina Rodriguez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 26, 2024

Hi, I have an automation that sends a web request. I need to send {{lookupIssues}} as a parameter, but it doesn't work because of the spaces in the list (ABC-1, ABC-2, ABC-3)

https://mysite/api?issues={{lookupIssues}}

I've tried creating a variable and using and all of these: 

{{lookupIssues}}

{{lookupIssues.trim()}}
{{lookupIssues.replace(" ", "")}}
{{lookupIssues.urlEncode}}
{{lookupIssues.key}}
{{lookupIssues.key.urlEncode}}

None of the above options works.

Is there any way I can remove the spaces before using the variable in my web request?

 

Thanks!

 

2 answers

1 accepted

2 votes
Answer accepted
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.
April 27, 2024

Hi @Carolina Rodriguez 

Currently, the default when a list field is used that way is to join the values of the default attribute with a comma and a space.  I have not found this default behavior documented, so it may be better to take some control over it...

Instead use an explicit join() function to force the key to delimit as you wish, with no spacing.  For example like this:

{{lookupIssues.key.join(",")}}

 

Kind regards,
Bill

Carolina Rodriguez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 28, 2024

It worked! Thanks!

Like Bill Sheboy likes this
0 votes
Kalyan Sattaluri
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.
April 26, 2024

Hello @Carolina Rodriguez 

Welcome.

Create a variable (mykeys) and assign it {{lookupIsses.key}}

Then you can remove spaces from the variable as {{mykeys.replace(" ","")}}

and pass it in your url https://mysite/api?issues={{mykeys.replace(" ","")}}

Please let me know if issues.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events