Is there a way to generate a list of files changed/added by a Stash pull request?

To estimate future work we would like to size of the work that was developed under a specific Epic.  To do this we would like to generate a list of the specific files that were changed/modified by the pull request attached to a JIRA story so it can be diffed against a previous baseline.  I can do this with the entire repository but cannot isolate only the code change by stories associate with a specific Epic.   Is this possible?

2 answers

Hi Mike,

I think for your purpose you could make use of the REST API function /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes, which returns you the changes for a given pull request, including files changed and added.

Regards,

Gustavo Refosco

As this is not paged it does not necessarily return a complete list.

Actually it says "This is a paged API" right under it.

Which is correct then. It also states: "Note: This resource is currently not paged. The server will return at most one page. The server will truncate the number of changes to either the request's page limit or an internal maximum, whichever is smaller. The start parameter of the page request is also ignored."

Hi Mike, I'm sorry - you're correct and it seems I totally ignored that statement. In this case I can't think of anything else for now, other than maybe using the function /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits (link https://developer.atlassian.com/static/rest/stash/3.11.1/stash-rest.html#idp2704704 ), which will return to you the commits included in the pull request - but then you would need to do some extra work checking for what changed in these commits. It seems the "changes" function was intended to be paged - I'm not sure if there's any plan in action to make it this way but please feel free to raise an improvement request for it at https://jira.atlassian.com

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

714 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot