Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Automation: Move ticket when all PRs are closed

Conrado Fonseca September 15, 2020

Greetings šŸ––

We are looking to automate the move of a ticket to a certain board column when all PRs have status closed.

I added this `development[pullrequests].open = 0` as JQL condition but it's not working 100% and I'm starting to think that need to add another condition to the JQL to match the current issue but couldn't find a way to compare the issue key.

The audit says:

JQL condition
The following issues did not match the condition:

 

pic-selected-200915-1329-38.png

1 answer

0 votes
John Funk
Community Champion
September 15, 2020

Hi Conrado - Welcome to the Atlassian Community!

Why do you have a check on the issue key? It is already only dealing with a single key. I would take that part out and see if it works for you. 

Conrado Fonseca September 15, 2020

Hi John, thanks for the fast response.

I was actually not checking for the issue key and I started to use it because sometimes the automation was not working properly with just (sometimes id did work)

development[pullrequests].open = 0

and the audit showing 

The following issues did not match the condition. 

Is there a better way to check if all PRs are closed ?

John Funk
Community Champion
September 15, 2020

Thanks for the clarification. I would run the query in JQL advance search to see if it returns a value there. Modify as necessary until you get the results you expect to see, then paste it back in the rule. 

Conrado Fonseca September 15, 2020

I have one issue with a single PR merged 

pic-selected-200915-1431-29.png

But when search for:

issuekey = <ISSUE_KEY> AND development[pullrequests].open < 0 

I get that No issues were found to match your search
 

John Funk
Community Champion
September 15, 2020

Merged and Open are not the same status for pull requests. Merged is not Open. 

And you can't say < 0 - that won't return you anything. You can use > 0 

Conrado Fonseca September 15, 2020

You are right, sorry, it was a typo. I was actually using an equal comparator.

Just found that this condition works only for issue type Bug, I'm able to get the proper results with:

issuetype = Bug AND development[pullrequests].all > 0 AND NOT development[pullrequests].open > 0

but not with any other issuetype value, think that is the reason the JQL is failing in the automation.

Removing the issue type, it just returns Bugs, there are any other kind of issue type being listed. 

John Funk
Community Champion
September 15, 2020

What's another issue type that would apply? And have you run the query just for that issue type? (Replacing Bug with that issue type).

Conrado Fonseca September 15, 2020

Task is another issue type. Going to attach some images to add more context to the issue.

Filter all Bugs with PR conditionlist-all-bugs-and-pr-filters.png

Filter all Tasks without PR condition, it's possible to see that the selected issue have a PR merged.

list-all-task.png

Filter all Tasks with PR condition, no issues listed
list-all-task-and-pr-filters.png

John Funk
Community Champion
September 15, 2020

That's very baffling!  I would open a support ticket with Atlassian.

https://support.atlassian.com/contact/#/

Please post the solution back here so we can close this one out. 

Like • Conrado Fonseca likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events