Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Create issue if a filter is not empty

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.

3 comments

John Funk Community Leader Sep 09, 2021

Hi Jacob,

You can create a Scheduled trigger in Automation for Jira to do that. 

Like Sarah Elmer likes this

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! 

Like Sarah Elmer likes this

Screenshot 2021-09-09 at 16.47.31.png

Looks like this at a super top level

Mykenna Cepek Community Leader Sep 09, 2021

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 @Craig Collins 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. 

image.pngimage.png

Mykenna Cepek Community Leader Sep 09, 2021

I notice in your trigger that you have this box checked:

Screen Shot 2021-09-09 at 11.35.21 AM.png

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?

Then I can't run the JQL and nothing happens. 

Mykenna Cepek Community Leader Sep 09, 2021

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".

Like # people like this

Ok, this is what it looks like now and it's working. Thanks!

image.png

Like # people like this

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you