Currently I am using the below API to get the pull requests raised for a branch.
https://stash.net/rest/api/1.0/projects/{}/repos/{}/pull-requests?
at=refs/heads/release-18&state=ALL&order=OLDEST&withAttributes=false
&withProperties=true&limit=100
I need to get all the pull requests created based on createdDate. Does bitbucket provide any API?
Currently I am checking the created date and filtering it.
def get_pullrequest_date_based():
"""
Get all the pull requests raised and filter the based on date
:return: List of pull request IDs
"""
pull_request_ids = []
start = 0
is_last_page = True
while is_last_page:
url = STASH_REST_API_URL + "/pull-requests?state=MERGED&order=NEWEST&withAttributes=false&withProperties=true" + "/results&limit=100&start="+str(start)
result = make_request(url)
pull_request_ids.append([value['id'] for value in result['values'] if value['createdDate'] >= date_arg])
if not result['isLastPage']:
start += 100
else:
is_last_page = False
print "Size :",len(pull_request_ids)
return pull_request_ids
Any other better way to do it.