here's the use case
1) I have to create 3 child issues in an epic. Mandate is to have it scheduled event and not the trigger based as the epic is already uploaded in jira through different system
2) Add 3 issues in an epic with summary <abc> , <pqr> and <lmn>
3) As its scheduled event , with scheduled jql - I am getting list of epics. Hence while adding these child issues, I have to make sure I am not adding it multiple times.
Eg : If in case issue with summary abc is already present then same should not get added again.
Tried approach-
Lookup for all child issues
Advanced compare for summary not in abc - then create abc
similarly for PQR and lmn
This is working for the first time but failing on second run onwards
What is the source of the content you posted?
As a reminder, posting completely bot / AI-generated content is not permitted in this community. And when such tools are used to modify content for a post, the sources are to be described in the text. To learn more, please carefully review the community rules of engagement / guidelines:
https://community.atlassian.com/forums/custom/page/page-id/rules-of-engagement
Indications the source of the post is bot / AI-generated are:
Kind regards,
Bill
if i understood your desired goal correctly:
The root cause of your issue
Your single Lookup + Advanced Compare approach works on the first run because there are 0 child issues yet. On the second run, the lookup returns existing issues, and the Advanced Compare fails to evaluate correctly because it operates on the entire result list - not per summary individually.
Recommended fix: One separate Lookup per summary
Instead of one lookup for all child issues, use three independent Lookup -> Condition -> Create blocks inside your Epic branch:
[Trigger] Scheduled
->JQL: <your Epic query>
[Branch: for each Epic]
[Lookup Issues] Name: lookupAbc
-> JQL: parent = {{issue.key}} AND summary = "abc"
[Condition] {{lookupAbc.size}} equals 0
-> [Create Issue] Summary = "abc" | Parent = {{issue.key}}
[Lookup Issues] Name: lookupPqr
->JQL: parent = {{issue.key}} AND summary = "pqr"
[Condition] {{lookupPqr.size}} equals 0
->[Create Issue] Summary = "pqr" | Parent = {{issue.key}}
[Lookup Issues] Name: lookupLmn
->JQL: parent = {{issue.key}} AND summary = "lmn"
[Condition] {{lookupLmn.size}} equals 0
->[Create Issue] Summary = "lmn" | Parent = {{issue.key}}
Key points to note:
summary = "abc" (exact match) not summary ~ "abc" because the ~ operator is a full-text search and can cause false positives with partial matcheslookupAbc, lookupPqr, lookupLmn) so their results are stored independently{{lookupXyz.size}} equals 0 checks that no issue with that summary already exists, making the rule fully idempotent and safe to run on any schedule{{issue.key}} in the Create Issue action to ensure the child issue actually lands inside the EpicThis way, each of the three summaries is checked and created independently, so a second (or tenth) run will never create duplicates.
Best
cF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just a little heads-up @Snehal Singh . I fed your exact requirement into our Alchemist agent:
"Add 3 issues in an epic with summary <abc>, <pqr> and <lmn>. Scheduled event with JQL. Make sure not adding it multiple times. If issue with summary abc is already present then same should not get added again."
The core problem: as @Bill Sheboy pointed out, you need If/Else blocks. Bare Conditions halt the entire rule on the first one that fails, so pqr and lmn never get checked. If/Else blocks let the rule continue to the next block even when the condition is false.
The pattern (per summary):
Same block for pqr and lmn with their own named lookups. The screenshot shows all three:
Possible Optimization: This should also work with a single lookup that fetches all children, then three If/Else checks against {{existingChildren.summary}} does not contain "abc", "pqr", "lmn", reducing three lookups to one.
Disclosure: I'm the developer of "Alchemist for Jira", a ScriptRunner companion. I used its Script Builder and as expected it detected that your use case doesn't need a script at all. Native Jira Automation handles it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @C_ Faysal_CFcon_
Your answer has provided some incorrect information.
There is no option to assign a Name to a Lookup Work Items action, so smart values like {{lookupAbc.size}} are not going to work. The smart value must be {{lookupIssues.size}} in all cases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy,
Thank you for pointing this out. You are right and I apologize - I used an AI tool to help draft the response and should have disclosed that clearly from the start.
Best, cF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For a question like this, context is important for the community to help. Please post the following:
Also for the Community Managers: this question was posted in App Central as a discussion. Please move it to the question area for Jira or Automation. Thank you!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.