Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Fill Insight field in issue with LookupIssue list of objects

Alexander Schäfer September 29, 2022

Hello all,

I am trying to populate an Insight field with objects gathered from multiple linked jira issues. I can retrieve said objects via {{lookupIssues.Devices & Components.id.distinct}}. It returns a list which looks like this  "[95], [96], [92], [1844], [99], [100]".

It seems that the brackets are causing some problems here. When I put in "objectid in (95, 96)" to populate the insight field it works. Can someone tell me how to solve this? Maybe some way to remove the brackets or convert the list to a string?

Any help appreciated! Thanks!

Rule.PNG

1 answer

1 accepted

0 votes
Answer accepted
Alexander Schäfer October 7, 2022

For future strugglers with a similar problem, here is the solution:

 

  • You can convert the list into a string by creating a variable

variable.PNG

  • afterwards you can use string operations:
    {{objectIdslinkedIssues.remove("[").remove("]")}} removes the brackets from the string and makes it readable for the "objectid in (some string)" function
  • if you dont want to overwrite the values in the current insight custom field you can create a second variable
  • variable2.PNG
  • via the concat function you end up with the rather nasty looking line:
    objectId in ({{objectIdslinkedIssues.concat(", ").concat(objectIdsCurrentIssue).remove("[").remove("]")}}) Note: You have to add an additional concat to insert a ", " between the two strings
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2022

Hi @Alexander Schäfer,

It looks like your value is a list of lists with 1 item in each. You might find you can add .first before the .id and resolves your issue? 

Suggest an answer

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

Atlassian Community Events