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: 

Merge-conflict status.

Douglas Jardim
August 15, 2022

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Mateus T
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 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:

https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/pullrequests/{id}

Within the response body, you will find a link to a diffstat, that will look something like this:

https://api.bitbucket.org/2.0/repositories/{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.

Cheers,

Mateus T

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events