How do I verify if a commit is a merge commit of a pull request using groovy scriptrunner for bitbucket server?
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```
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still have a question?
Get fast answers from people who know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.