I am try to get a list of all pull-request, but it never request those that have been merged or declined.
I am using /projects/{projectKey}/repos/{repositorySlug}/pull-requests
am I using the wrong request? Thanks a lot!
Community moderators have prevented the ability to post new answers.
Hi Simon,
It appears our REST documentation is a bit misleading for that resource. You'll need to supply an additional query parameter to retrieve pull requests in a non-open state.
GET /projects/{projectKey}/repos/{repositorySlug}/pull-requests?state=DECLINED
Will return declined pull requests.
GET /projects/{projectKey}/repos/{repositorySlug}/pull-requests?state=MERGED
Will return merged pull requests.
I've raised https://jira.atlassian.com/browse/STASH-3162 to fix the documentation. Thanks for pointing this out!
cheers,
Tim
Hi again Simon,
To answer your second question:
> For those pull-ruquest which are open, how do I get the list of "APPROVED","UNAPPROVED" activities?
The following REST API will return you a list of all activities for a particular pull request:
GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities
There is currently no way to limit the response to just approved/unapproved items, so comments and other activity items will be in the response as well. If this limiting activity to a certain type is important to you, I'd recommend raising an issue in the Stash project at https://jira.atlassian.com.
If you're curious, the full Stash REST API documentation is available here: https://developer.atlassian.com/stash/docs/latest/reference/rest-api.html
cheers,
Tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Follow-up question from customer:
I still need something else, wonder if you help me again:
For those pull-ruquest which are open, how do I get the list of "APPROVED","UNAPPROVED" activities?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank a lot!
I still need something else, wonder if you help me again:
For those pull-ruquest which are open, how do I get the list of "APPROVED", "UNAPPROVED" activities?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.