Forums

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

Pull Request Comment Source and Destination Rev

Daniel Schlatter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2024

Hi

I have noticed, that if you fetch the activity from a pull request with a field parameter enabling the "inline" contents, such as follows:

curl -G "https://api.bitbucket.org/2.0/repositories/XXX/YYY/pullrequests/ID/activity?fields=%2Bvalues.comment.inline.*"

...you get a response with pull request comments having a "src_rev" and "dest_rev" field. I find these fields very helpful, but I can't find them in the open API specification. Also the pull request activity seems to have no type (scheme) associated with it.

Is this intended? Is it a deprecated or removed feature or will it remain in the API?

Regards

2 answers

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2024

Hello @Daniel Schlatter ,

and welcome to the Community!

The reason you don't see a specific schema associated with the activity endpoint is that it can return multiple types of events within its array, such as comments, approvals, updates, and requests for changes. Each of these event types has its own specifications, which can be found in their respective endpoints in the Bitbucket API documentation, like the List comments on a Pull Request  or the List Tasks in a Pull Request.

Regarding the use of the fields parameter to expand the results, this is because most objects that are embedded within other objects (such as how an inline property is an embedded object within a comment) appear in a "condensed" form, which omits many fields or does not load them by default.

Embedded related objects are generally limited in their fields to prevent these object graphs from becoming too deep and noisy, often excluding their own nested objects to strike a balance between performance and utility. This does not mean the field is being deprecated, just that for optimal performance it's omitted from the default response from the API.

In such cases, the fields parameter allows you to pull in additional fields, providing more detailed information when needed, just like you achieved when adding the field parameter of "fields=%2Bvalues.comment.inline.*".

I hope that helps! Let us know in case you have any questions.

Thank you, @Daniel Schlatter !
Patrik S

 

0 votes
Daniel Schlatter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 3, 2024

Hi Patrik

thank you for the detailed answer, yes that helps :)

 

Regards

Daniel.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events