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

mtrobbin July 12, 2018

Hi,

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?

Thanks,

Matt

 

 

1 answer

0 votes
adammarkham
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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?

Thanks,
Adam

mtrobbin July 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 so...do you happen to have an example?

mtrobbin January 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?

dafalcon April 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
TAGS
AUG Leaders

Atlassian Community Events