Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Check if a commit is a merge commit - Bitbucket scriptrunner

How do I verify if a commit is a merge commit of a pull request using groovy scriptrunner for bitbucket server?

1 answer

You just need to check the length of the `parents`. If there are two or more commits, it's a merge commit, otherwise it's a regular commit.


```commit.getParents().size() >= 2```

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events