How do you limit Jira Automation LookupIssues results?

Aqib.Shirwani April 24, 2023

I'm creating an automation that uses the LookupIssues field. I use the data from the lookupIssue field and push it all into in an "edit comment on issue" block. 

 

Right now, I'm seeing results of 100 tickets at time. Is there a way to limit these to 10 results?

2 answers

1 accepted

3 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

Hi @Aqib.Shirwani 

LookupIssues component may return a maximum of 100 issues (https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Automationactions-Lookupissues). Since the {{lookupIssues}} smart value is considered to be a list, you can use any of the list methods found here https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/

Limiting is going to be tricky. The .get(index) method would give you the first item from the list.

Aqib.Shirwani April 24, 2023

That's exactly what I needed! Thank you @Alex Koxaras _Relational_ 

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

@Aqib.Shirwani good to know that!

Glad to be of help! Kindly mark my answer as accepted in order to help others in the community with the same question. Much appreciated! :)

Like Aqib.Shirwani likes this
Aaron P. May 18, 2023

Hi @Alex Koxaras _Relational_ , I have the opposite problem, I need list more of 100 result, Is possible increase this limit o use other method?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 18, 2023

@Aaron P. not any that I'm aware of. You have to narrow down your search

Aaron P. May 19, 2023

Thanks for you response Alex.

But what a disappointment :(
As you well pointed out is possible create a limit, but that this variable have a limit so low is totally irrational.
I hope that Atlassian increase this limit or remove completally.

Aaron P. May 26, 2023

Hello everyone,
Just to comment that opening a case in atlassian to extend this limit, they have told me that at the moment they have no intention of doing so, but that this incident exists: https://jira.atlassian.com/browse/JSDCLOUD-11414
If the necessary votes are added they will implement it.

1 vote
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 24, 2023

Hi @Aqib.Shirwani 

There are a couple of things to help with this, but unfortunately they cannot be used together: {{index}} for a list and smart value, list filtering.

The work-around is to call lookup issues twice, and filter the list the second time:

  • action: lookup issues, with JQL which has an ORDER BY statement for your desired order.  Let's assume it is by Key.
    • project = myProjectName ORDER BY key
  • action: create a variable to save the key of the 10th item in the list, using the zero-based index
    • variable name: varTenth
    • smart value: {{lookupIssues.get(9).key}}
  • action: lookup issues, with JQL which has an ORDER BY statement for your desired order, and this time add the variable
    • project = myProjectName AND key <= {{varTenth}} ORDER BY key
  • ...your lookup results now only contain the first 10 issues

 

Kind regards,
Bill

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

That's a nice workaround @Bill Sheboy ! I've tried to insert a list as a smart variable and split it in order to get its size, and then pass the individual items within the {{lookupIssues.get(index)}} smart value, but unfortunately it doesn't work like this. Even with the solution I provided, a lookupissue of 100 results takes about 10 secs. And if @Aqib.Shirwani is running all the time this rule, then he will hit the service limits in no time.

Like Sunil Racha likes this
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 24, 2023

Interesting...I tested mine on a large project, and it took 5-7 seconds for a both calls to lookup issues: the first is 100 issues and the second is 10.

Slight detour from this question: At this time, created variables do not preserve object typing...but...Lookup Tables do.  I experimented with this and found a lookup issues result could be stored in a lookup table, entry value, and de-referenced later as lists, issue fields, etc.  You may want to try that for your earlier use case/scenario.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2023

@Bill Sheboy 

About my instance and the 100 lookupissues:

100 issues lookup.png

I'm on a standard plan, and I don't know if the performance is lower than that of another plan e.g. premium. I support not, but you never know!

Concerning the lookup table, I'll try to experiment with that! Thanx for the info!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events