Merge-conflict status.

I use a small program to interact with the bitbucket api to get if a P.R. has any conflicts. Two weeks ago, I run this little program and now sometimes it returns the status of a file as modified and not as a merge conflict. When I open the P.R. in bitbucket, the conflict appears. Does anyone have any suggestions or guesses as to what this problem might be and how it could be solved?

I grabbed the full text of the json and check to see if anything has changed. The only thing I could find was the status description, from "merge conflict" to "modified".

1 answer

0 votes
Mateus T
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 18, 2022

Hi @Douglas Jardim,

Thank you for reaching out to the Atlassian Community!

Since Bitbucket introduced topic diffs in order to improve the speed and performance while calculating complex diffs, conflicts are calculated differently in the backend and exposed differently through the API.

Currently, the API using topic diff will show all files are modified, however, you can use the following API endpoint to get the conflicts on your files:{workspace}/{repository}/pullrequests/{id}

Within the response body, you will find a link to a diffstat, that will look something like this:{workspace}/{repository}/diffstat/{workspace}/{repository}:{OMITED}?from_pullrequest_id={id}&topic=true

Just replace the topic=true flag by merge=true do a GET request.

In any case, these are the steps this 3rd party tool should follow to grab those conflicts, so I'd advise reaching out to the owners of that tool to adjust the internal API call.


Mateus T

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events