The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Check if a commit is a merge commit - Bitbucket scriptrunner

Narasimha Velagaleti
November 28, 2018

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

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
majensen
January 28, 2020

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```

TAGS
AUG Leaders

Atlassian Community Events