Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Asset ID from an Issue to a new Issue

oscar.mora October 31, 2024

I'm creating a new Issue using the values from an existing Issue, when I try to obtain the value of an Asset object field in an automation using {{lookupIssues.customfield_10377.Name}} I get the value between brackets i.e.[objectname] when using this value in the asset type field is not working as it takes it as text.
Another thing that I have tried is using replace to remove the brackets {{lookupIssues.customfield_10377.Name.remove("[")}} but the value is removed i.e.[]

Is there a way I can get the value without the brackets?

1 answer

0 votes
Mikael Sandberg
Community Champion
October 31, 2024

Hi @oscar.mora,

Welcome to Atlassian Community!

What does your automation looks like? Normally when you are setting an Assets custom field you have to use the Asset ID, not the display name. So without knowing what your automation looks like you could try {{lookupIssues.customfield_10377}} since that should be the Asset ID.

oscar.mora October 31, 2024

Hi Mikael!


The automation consists in when an issue is created, we look for an Issue, based on a key provided in the request form, then we use the look up issue fields to fill the fields of the new one, but we are having issue accessing the value of an assets object field because the value that we get is in between Brackets.


But when I try {{lookupIssues.customfield_10377}} the result value is between the brackets [Asset ID] and that is blocking because in my assets we don't have the value [Asset ID] we have de "Asset ID" so the result is that there is no asset.

Mikael Sandberg
Community Champion
November 1, 2024

The brackets are there if the Assets field is set to allow multi-select. Give this a try:

{lookupIssues.customfield_10377.replace(", ",",").replace("[","").replace("]","")}}

oscar.mora November 1, 2024

I'm still getting this
Screenshot 2024-11-01 100757.png

 

It seems that you cannot use any extract text actions if the value is within square brackets, as the result will be None.

 

Mikael Sandberg
Community Champion
November 1, 2024

Another thing you can try is to use the advance branch and iterate over each value in the assets field. 

Screenshot 2024-11-01 at 10.29.29 AM.png

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