Missed Team ’24? Catch up on announcements here.

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

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

Mike Zielinski July 23, 2015

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

0 votes
Mike Zielinski July 23, 2015

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

gustavo_refosco
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2015

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

Mike Zielinski July 23, 2015

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."

gustavo_refosco
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2015

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

0 votes
gustavo_refosco
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events