Bitbucket server Rest API - get Tasks of Pull Request

ishara93 April 16, 2020

Hi all,

i am using bit bucket server rest api to get tasks created in pull request.

http://localhost:7990/rest/api/1.0/projects/TES/repos/codeextractor/pull-requests/1/tasks

when i call this url it will return empty value array even though pull request has two open tasks.

using bitbucket server version - 7.1.1

any help appreciated.

 

thanks

Ishara

 

2 answers

0 votes
Chandravadan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 23, 2020

You're likely seeing an empty list because those are tasks without a parent comment. The ability to add top level tasks (tasks without a comment) was added in Bitbucket 7 and up, and as of 7.1.1, a REST API for fetching these hasn't been implemented. We're implementing that shortly, watch out for 7.2 and up!

Aaron Geier January 21, 2021

We are using Bitbucket Server 7.8.  I've noticed that tasks without a parent comment show up; however, it doesn't appear much different than an actual comment.

If I want to be able to differeniate between a "task" type and a "comment" top at the parent level, how do I do that?  I noticed the "severity" field in the JSON REST API response says "blocker" for an open task. 

 

Is the severity field a field that we could key on to differenitate, or will Atlassian update the REST response in the future to indicate if it is a task vs. a comment?

Like RayFroehlich likes this
duane_crouch July 23, 2021

I know it may be late to help Aaron, but if anyone winds up here as I did looking for a solution I hope this may help them.

https://docs.atlassian.com/bitbucket-server/rest/7.14.0/bitbucket-rest.html#idp355

Shows that the API is deprecated and we should use a blocker-comment as such there, and you'll see something similar as we have.

{"RESOLVED":6,"OPEN":7}

 

Deprecated since 7.2. Tasks are now managed using Comments with BLOCKER severity. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments?count=true instead.

The root where I found the solution is here.

https://docs.atlassian.com/bitbucket-server/rest/7.14.0/bitbucket-rest.html

Like Aaron Geier likes this
0 votes
ishara93 April 19, 2020

any help ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events