Forums

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

is it possible to restrict merging github pull requests unless a jira is attached

Mathieu Jobin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 29, 2018

when putting a jira ticket in a commit message or PR title, it gets automatically linked in the jira ticket. That's useful.

 

I'd like to expand on that link and actually prevent any PR from being merged unless a jira is attached.

 

maybe the github project could be registered to be watched, and all PR would be blocked by default, until that link is present.

 

the new Github Checks API could be used

 

https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/

 

thank you

 

1 answer

0 votes
Tarun Sapra
Community Champion
May 30, 2018

The pull request should have an successful build before getting merged in the branch and this can be set in Jenkins. I suggest you go through this doc, it's an interesting way of implementing something which you want.

https://www.linkedin.com/pulse/validating-github-pull-request-titles-jenkins-builds-when-roger-soucy/

 

Tarun Sapra
Community Champion
May 30, 2018

And if also want commit messages to follow a certain convention like including a Jira issue key then you can use this 

Tarun Sapra
Community Champion
May 30, 2018

Suggest an answer

Log in or Sign up to answer