Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Merge pull request when issue transitioned

Ben Harris July 26, 2023

I have seen articles about automatically moving an issue when the linked pull request has been merged but is there a way to do the opposite. Merge the pull request when an issue has transitioned from one column to the another?

1 answer

1 accepted

1 vote
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2023

Hi @Ben Harris -

You'll probably end up needing to send a Web request to Bitbucket's REST API. Here's a good explainer on that:

This is the endpoint to: Merge a pull request 

I highly recommend that you add a comment indicating that the merge was done by an automation in Jira, just so there's good accountability/visibility into the process.

The other thing to consider is how you'll deal with merge failures. It looks like the endpoint can potentially return a 202 status code and you would then need to get the merge task status, which could show an error.

You would want to include a way to handle for that error (add a comment with the error message, and then move the issue back to the previous column?)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events