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

Bitbucket ScriptRunner Merge Check - Require jira tickets in jql filter not checking all tickets

Matt Jul 12, 2018


I'm using the Adaptavist Scriptrunner built in merge check to validate that all tickets on a pull request must show in the jql filter.  The issue is if there are multiple jira tickets associated with the merge commit it will allow the merge to go through if only 1 of them matches the jql criteria.  The docs says it will check all tickets so I would expect it to not be merge able unless all tickets appear in the jql.  Any advise or clarification here?





1 answer

0 votes
Adam Markham [Adaptavist] Community Leader Jul 13, 2018

Hi Matt,

The merge check will allow the merge if at least one of the Jira issue keys on the pull request exists in Jira.

Sounds like your case requires something different. Is the merge commit made before you merge the pull request or after you merge? I'm assuming before for it to be picked up by the merge commit?


Matt Jul 14, 2018

Its not coming from a merge commit.  We're using pull requests to control hot fixes and if a dev rolls several fixes into a single pull request it will pickup multiple jira tickets.  My assumption (not clear in the docs) is that all tickets have to match up.

Is there a way to make it work this way?  Would it be possible to go with a custom groovy script?  If you happen to have an example?

Matt Jan 28, 2019

So, is there anyway to make it work this way?  What about just going with a custom script?  Are the built in checks opened sourced?

Dan Falcone Apr 18, 2019

I'm also looking for an answer to this.  We have the exact same issue - merge check passes if any tickets match, but we need all tickets to match.  

Is there a way to write the JQL to force all tickets to match?  

If not, how can we do it with a custom script?  How do you list all Jira tickets associated with a PR?

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Marketplace Apps & Integrations

Webinar invitation: Generate custom Jira Cloud PDF reports and exports

Jira may be a staple part of your workday, but your colleagues, customers, business partners or an auditor might need information presented in a different format, that is easy to access and read. And...

42 views 0 1
Read article

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