Custom merge check based on Jira ticket status

Nick de Palézieux
Contributor
September 20, 2024

I'm looking into custom merge checks with forge.

What I want to implement is a merge check that prevents merging a PR if the linked Jira issue is not in the correct status. Only once a Jira ticket has gone through approval do we want to merge the PRs.

Looking at the documentation for custom merge checks, I see that there are triggers to evaluate the merge check when code is pushed to the PR branch etc.

For my check to work, I need to also be able to trigger based on events in jira, i.e. I need to re-evaluate the merge check when the linked jira issue changes its status.

 

Is this possible?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 23, 2024

Hi Nick,

There is no trigger to invoke the merge check based on the linked Jira tickets' status. You can see the available triggers here:

However, the on-merge trigger can be used, which is invoked when someone tries to merge a PR. If this type of check fails and if the check was configured to be Required, then the merge will be aborted.

Would this work for you?

Kind regards,
Theodora

Nick de Palézieux
Contributor
September 25, 2024

Thanks for your response Theodora.

It's not great since it requires that the developer tries to merge and then gets rejected. It would be much better if they can know ahead of time whether this is good to merge or not. I'd even want to notify them somehow (e.g. through an automated comment on the PR) that the result of the check has changed.

Saxea _Flowie_
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.
September 26, 2024

Hi @Nick de Palézieux

We intend to add support for Jira based merge checks to Flowie, our Bitbucket Cloud app add-on. If you're interested in getting early access and providing feedback, please get in touch with us via our website.

 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 27, 2024

Hi Nick,

Thank you for the feedback.

I created a feature request for what you're asking in our public issue tracker:

I suggest adding your vote to that feature request (by selecting the Vote for this issue link) as the number of votes helps our product managers better understand the demand for features. You are more than welcome to leave feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to be notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request.

Kind regards,
Theodora

Like Nick de Palézieux likes this
Nick de Palézieux
Contributor
September 27, 2024

Thanks @Theodora Boudale !

 

If there was an easy way to trigger the re-computation of a custom merge check through a Jira automation rule, that might also be a step in the right direction.

Is that possible?

Then I can have the triggering logic on the Jira side but implement the more complex merge-check logic in code.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 30, 2024

Hi Nick,

I don't believe that is possible, but I haven't worked extensively with Forge apps so I am not 100% sure. You can ask your question here:

This group is specifically for Forge for Bitbucket Cloud and and they may be able to give you a workaround, if a workaround exists.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events