I want to create a jira issue/ticket for a filter if it's not empty and link the tickets.
For example, I have tickets moved to "backlog" but did not enter a "follow up" date, so I have a filter to return those tickets.
project = KBS AND "Follow Up[Date]" = EMPTY AND type != epic AND resolution is EMPTY ORDER BY created DESC
I want each morning for a new issue to be created linking any tickets that are pulled by this filter with a new issue called "assign dates" or something. When I tried to automate it made a new issue for each issue returned by the filter, not one issue linking all of the issues.
Hi Jacob,
As John referenced you can use the scheduled trigger in automation, set the JQL condition (if JQL matches X) then set a new action to create ticket!
From the OP, it sounds like the concern is that his rule creates multiple tickets when he wants just one ticket created. I suspect the problem isn't the trigger or using JQL.
Is that right, @Jacob Rosenfeld? If so, it would help us to see a screenshot of your rule (similar to what @Margareta Buruian illustrated above).
Correct. It wasn't just the issue creation, I also wanted them linked within the issue.
This is the rule that made a new issue for each issue returned.
I notice in your trigger that you have this box checked:
Note how this says that it will execute actions (your "Create issue" component) for each issue in the JQL result.
Have you tried unchecking that box and testing the rule?
So it seems that using JQL in the Scheduled trigger isn't going to do what you want.
I'm going back to your OP, where you stated:
I want each morning for a new issue to be created linking any tickets that are pulled by this filter...
To run a rule once per day, you do need to use the Schedule trigger. So uncheck the box and skip the JQL in the trigger component of the rule.
Here is some pseudocode for what I suggest for your rule (after the trigger):
1. Terminate early if no issues match your JQL
2. Create a new issue
3. Loop through the JQL and link to the new issue
For part 1, use a JQL Condition with your JQL. If no issue match, the rule will not continue. No new issue will be created (I think this is what you want, right?).
For part 2, use the Create Issue action.
For part 3, start with a Branch / Related Issues component, configured with "Type of related issues" to contain your JQL. In that loop, use the "Link issues" action which allows you specify the "Most recently created issue".
Ok, this is what it looks like now and it's working. Thanks!
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Jira Administrator
Configure Jira Software, Jira Core, or Jira Service Management, including global settings, permissions, and schemes.
Managing Jira Projects Cloud
Learn to create and configure company-managed projects in Jira Software and partner effectively with Jira Admins.
Learning Path
Become an effective Jira Software Project Admin
This learning path is designed for team leaders who configure Jira Software projects to match a team's processes.