Forums

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

Referencing multiple lookups

Jamar Jenkins
Contributor
March 3, 2022

Are there any plans to configure an option to reference multiple lookups? 

 

I am working on automation that I would like to use more than multiple JQL lookups in, but it seems that at this time it seems that there is a limitation of 1. I was wondering if something could be implemented where the lookups could get number tags to use multiple?

i.e.:

  • {{#lookupIssues}}
  • {{#lookupIssues1}}
  • {{#lookupIssues2}}

1 answer

1 accepted

0 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.
March 3, 2022

Hi @Jamar Jenkins -- Welcome to the Atlassian Community!

An interesting idea, and I have not found any open suggestions to add this feature.  Perhaps you could add a suggestion with a use case example for your needs.

I recall seeing a post about improving Created Variables to preserve the objects stored in them rather than converting to text.  If that happens, there would be no need for multiple lookups: just perform a lookup and store the results in a variable for later use via iterators.

Kind regards,
Bill

Jamar Jenkins
Contributor
March 4, 2022

So that works. Thank you. Now I just need to figure out how to manipulate the way the information contained in the variables are displayed. 

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.
March 4, 2022

Up to a point, yes.

You could use a Lookup Issues action with JQL to return up to 100 issues, and then use list iterators to parse and store that in a created variable.  For example, storing a CSV list of keys or other fields for later use.

Another relatively new feature to reduce the need for multiple lookups is smart value list filtering: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588

With that, you could do one lookup and then filter the list repeatedly to meet your needs.  An example use case for that would be to calculate a percentage done for issues in a sprint, epic, etc.

Jamar Jenkins
Contributor
March 4, 2022

I think you answered while I was updating my comment. This particular request is completing the desired results. I now just need to figure out how to change this display. When I want to display 1 lookup Key (as URL) | assignee I can use the following:

{{#lookupIssues}} 

<a href={{url}}>{{key}}</a> | {{assignee.displayName}}

{{/}}

 

Not sure how to translate that to the variable(s) though. 

 

 

Thank you again. 

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.
March 4, 2022

Two ways to do that I can think of:

  • Pre-build your message lines as you show above using the iterator, storing in the variable.  Later split them back into lines for presentation (or message send).  I have used this technique to pre-build text to put into emails based upon multiple lookup issues calls.
  • Build your own delimited records in the variable and then parse them later.  For example, adding a prefix/suffix to wrap each field desired, concatenate, and then later split back out and use match() to pull each field.  The challenge with this approach is the encoding in the URL and other fields could cause problems on the split later.
Jamar Jenkins
Contributor
March 4, 2022

@Bill Sheboy Thank you for all of the help. I found that when creating the variable if I put in the formatting in the "smart value" it displays the way I wanted it to. Use HTML tags it can be a list or table. 

variable with formatting.png

Like # people like this

Suggest an answer

Log in or Sign up to answer