How to find open PullRequests in one project by multiple authors?

Maksim Lanin April 1, 2020

We have a huge monorepo with lots of committers. In our team we have a slack bot that shows daily stats and we want to add info about open PRs to its messages. How to fetch open PRs by several authors using api? 

Documentation says that I can filter them by multiple users, but is seams like this method uses usernames as AND constraint.

1 answer

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

If I understand you right you'd like to get the list of PRs of all the users from your team from a specific repository, without sending requests for each specific user (PR author).

According to REST API docs you can use the following end-point to get the list of pull-requests from the repository, then filter that by the users you care about on the client-side, because filter by usernames is additive (AND), not multiplicative (OR).

/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests

Hope it helps

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events