Dear all,
I'm creating an automation -
1. Trigger occurs when the current issue transitions from UAT to SIT (in the project: CRBT).
2. New issue has to be created in the other project: SIT, issuetype: Test
3. Here's the catch: There's already multiple SIT's issues already linked to the current issue through the issue-link-type: 'Demand'.
Now I want to create a single SIT issue, based on the details available in the most recently linked/created SIT issue.
I've written an automation with the following steps.
1. Trigger: current issue transitions from UAT to SIT
2. Branching: For linked issues, linktype = Demand
All actions inside Branch -
3. JQL: to filter-out for all 'SIT' issues.. issues from other projects filtered-out.
4. Lookup issues: issue in LinkedIssues("{{triggerIssue.key}}") AND issueType: Test ORDER BY created Desc. This gives me all the SIT issues
5. IF: Advance compare values: {{lookupIssues.size > 0}}. inorder to filterout for most recently created SIT issue.
6. Created a new issue: SIT project, Test issuetype.
Now, when this rule is triggered, Lookup option filter-outs for all the SIT issues in the linked issues, but creates multiple new issues, one for each SIT issue brought by the lookup action.
Looks like the condition number 5 fails to filterout for only the last created SIT issue.
Can someone advise how this condition be modified to list only for the last created issue.
There are two design problems with your rule: it is branching over all of the linked issues (potentially adding several issues), and the JQL used in the Lookup Issues action does not account for the link type.
For a scenario like this, I recommend first writing the JQL you would use to identify that single, SIT issue which was most recently added, with the specific link type. This could be done with an example issue which would have triggered your rule.
Once that JQL is working, you may use the Lookup Issues action and get the single issue you want. Then, use a Branch on JQL to just that single issue, and inside the branch, add the Create Issue action to copy to the data from the branched-to issue.
Kind regards,
Bill
Hi Samuel,
I understand you're trying to make sure that your automation rule only uses the most recently created SIT issue linked via the "Demand" issue link type, and you're currently seeing multiple issues being processed due to the lookup returning more than one result.
You're on the right track with the ORDER BY created DESC
in your JQL, but Jira Automation treats the lookupIssues
as a list, and unless you explicitly tell it to use only the first one, it will process them all.
Use the {{lookupIssues.first}}
smart value to only access the first issue returned (i.e., the most recently created one). Anytime you need to access a specific issue while using a lookup, you must specify it.
issue in linkedIssues("{{triggerIssue.key}}") AND project = SIT AND issuetype = Test ORDER BY created DESC
{{lookupIssues.first.key}} is not empty
Do not use a branch on lookupIssues (it is already like a branching so you're using it twice)
, as that will run the actions for each item in the list. Instead, just reference the first one directly using smart values.
This will ensure that only one new SIT issue is created, and it will be based solely on the most recently created linked SIT issue.
Let me know if this works for you.
Hope this helps,
Melbrin from Paris ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When posting bot / AI-generated content, ensure you disclose the source in your post text. For more information, please carefully review the community guidelines:
https://community.atlassian.com/forums/custom/page/page-id/rules-of-engagement
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.
Hi Bill, as I mentionned in my message, this is a problem I've encoutered before. I just use AI for writing and structuring the answer but thanks for the tip ;)
Melbrin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.