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

How to get the source branch of the latest merged PR?

swetha ramakrishnan
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!
May 15, 2024

I trigger a jenkins build from master when a PR is merged to my master branch. And i have few post actions to be done after my build for which i need the source branch of the latest merged PR to master. Could you help me with the steps on how to get this data.

1 answer

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2024

Hi @swetha ramakrishnan,

Welcome to the community.

This information can be obtained by using the REST API endpoint below, querying the source branch, and sorting it based on the updated date.

/repositories/{workspace}/{repo_slug}/pullrequests

API Reference: List pull requests
Querying and Sorting reference: Filter and sort API objects

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events