Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket server Rest API - get Tasks of Pull Request

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

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!

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

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

any help ?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,741 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you