Can bitbucket pull request link be added to commit message when merged?

Michelle Geppert January 27, 2022

I would like to add the pull request code review link at the bottom of every commit message.  Can this be done?

Scriptrunner runs at the time of merging so it seems like I use that.

1 answer

1 accepted

0 votes
Answer accepted
Robert Giddings [Adaptavist]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 28, 2022

Hi @Michelle Geppert ,

Thank you for your question.

I am the Product Manager for ScriptRunner for Bitbucket.

I believe something like that could be achieved using a Custom Listener (https://docs.adaptavist.com/sr4bib/latest/features/listeners/custom-listeners) to listen to Pull Request merge events and then automatically amending the affected Git commits.

However, I'd like to understand further as to why you want to do this, to see if we can help you to achieve what you want to achieve in a better way?

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

Michelle Geppert January 31, 2022

Thanks I'll checkout customer listeners.

We'd like to be able to go from 'git log' to a code review (pull request) easily.  We'd like to do this for 2 reasons

1. to see what's in the commit

2. to see what discussions there were around the commit

Mainly the first one.

Our team is moving from git with Gerrit and we had the review link automatically added to all commit messages.

A neighboring team is moving from code collaborator and perforce and they manually added the link to the commit messages.

Michelle Geppert February 21, 2022

Listerners would probably do the job but there's no example code for how to run a git command from a listerner or how to do it another way.  I'm too new at this not to need example code.

I did find that it's fairly easy to go from a commit hash to the commit link which has the pull request link.  So we can going to use that method.

Robert Giddings [Adaptavist]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2022

Hi @Michelle Geppert ,

Sorry for the late reply!

Do you still require a code example, to help you?

As your last comment seems to suggest that you may have found the solution to your problem?

Please let me know if you require any additional help?

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

Michelle Geppert June 13, 2022

I decided to go a different way.  thank you for your help

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events