Automation: LookUp Issues Action is Creating Hundreds of Tickets
Asked by Jeffrey Bistrong:

With a scheduled event I am going multiple Lookup issues and then placing the lookup.size into a variable. I am looking to do an automated ticket once a week that reports out the the count of issues.

The final output is outputting this and also creating hundreds of tickets

![\[POPS-2\] Week of Issue Summary - JIRA 2022-02-13 22-58-53.png](/t5/image/serverpage/image-id/183771i80E24DDF6591123F/image-size/large?v=v2&px=999 "[POPS-2] Week of Issue Summary - JIRA 2022-02-13 22-58-53.png")

![Automation - JIRA 2022-02-16 09-12-46.png](https://community.atlassian.com/t5/image/serverpage/image-id/183786iE6B358B202E137D9/image-size/large?v=v2&px=999 "Automation - JIRA 2022-02-16 09-12-46.png")

This is what each lookup looks like and then below is the variable.

![Automation - JIRA 2022-02-15 11-57-31.png](/t5/image/serverpage/image-id/183768iF650A08CAD7BDDD1/image-size/large?v=v2&px=999 "Automation - JIRA 2022-02-15 11-57-31.png")

![Automation - JIRA 2022-02-15 11-57-49.png](/t5/image/serverpage/image-id/183767iF3E791F7E4C1E0AA/image-size/large?v=v2&px=999 "Automation - JIRA 2022-02-15 11-57-49.png")

This is an overview of what the automation rule looks like as well as the final "create issue" which is creating hundreds of tickets

![Automation - JIRA 2022-02-13 22-56-28.png](/t5/image/serverpage/image-id/183772i963BD7A0083A7A93/image-size/large?v=v2&px=999 "Automation - JIRA 2022-02-13 22-56-28.png")


Answers:
author: Stefan Salzl
body: Hi [@Jeffrey Bistrong](/t5/user/viewprofilepage/user-id/1190841) ,

I just checked your "set value" action. I?m not quite sure if smart values are case sensitive but I know the lookup issue smart value in camel case {{lookupIssues.size}}. --\>capital "I" for issues

Could you try this and maybe also add a "log action" after the "set variable" to see if the variable was set corretly.

Best  
Stefan

comments: author: Jeffrey Bistrong
body: after changing to the capital "I", i am now getting the correct output, but it is still creating a hundred or so issues![Automation - JIRA 2022-02-16 10-30-01.png](https://community.atlassian.com/t5/image/serverpage/image-id/183808iD347FD3BC2EAD49E/image-size/large?v=v2&px=999 "Automation - JIRA 2022-02-16 10-30-01.png")![\[POPS-225\] Week of Issue Summary - JIRA 2022-02-16 10-29-12.png](https://community.atlassian.com/t5/image/serverpage/image-id/183807i9EF98D1D7764919A/image-size/large?v=v2&px=999 "[POPS-225] Week of Issue Summary - JIRA 2022-02-16 10-29-12.png")


author: Stefan Salzl
body: Could you please provide a screenshot of your trigger settings?

The reason for my question is the following:  
I tried to re-build your rule in my site. When I add the "scheduled" trigger in combination with the "re-fetch" action Jira forces me to add a JQL (to which the "re-fetch" could then refer) within the trigger. And with this set the action is executed for all issues of the result (see screenshot)

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/183852iD46762104C951BF3/image-dimensions/448x264?v=v2 "image.png")


author: Mykenna Cepek
body: Nice catch, [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993). Almost certainly the "Run a JQL search and execute actions for each issue in the query" option is erroneously checked.


author: Stefan Salzl
body: Thank you very much [@Mykenna Cepek](/t5/user/viewprofilepage/user-id/3527113) . Highly appreciate and feel honored by getting such a feedback from a community leader :)

Let?s hope we caught the right thing ;)


author: Jeffrey Bistrong
body: yes, thank you unchecking it did the trick!!! thank you so much for helping me get to the bottom of it


author: Stefan Salzl
body: Awesome. Glad to know it works now. Thanks to all of you in this conversation for your effort to find a solution :)

happy automating to you guys ;)


author: Mykenna Cepek
body: Your screenshot ends after the third "And create variable" component. So we can't see what your rule looks in the vicinity of the "Create issue" component.

Please post a screenshot of the bottom half of your rule (so we can see ALL the rule components).

comments: author: Jeffrey Bistrong
body: thanks, updated


author: Mykenna Cepek
body: Ok. What does your Audit Log for this rule show? Can you screenshot both the overview (all recent runs and changes for this rule) as well as the details for the latest execution?


author: Jeffrey Bistrong
body: ![Automation - JIRA 2022-02-16 10-12-05.png](https://community.atlassian.com/t5/image/serverpage/image-id/183804i258476B9FB4A6864/image-size/large?v=v2&px=999 "Automation - JIRA 2022-02-16 10-12-05.png")![Automation - JIRA 2022-02-16 10-11-49.png](https://community.atlassian.com/t5/image/serverpage/image-id/183803i027BBCCD76358007/image-size/large?v=v2&px=999 "Automation - JIRA 2022-02-16 10-11-49.png")


Tags: cloud