Query not workingI'm trying to fetch pull requests by created date but the query is not working.i tried multiple queries with dates but none seems to be working.Can anyone help me with how to structure the queries with dates
https://api.bitbucket.org/2.0/repositories/${workspace}/${repository}/pullrequests?q=state="MERGED"&created_on>2023-11-19T14:19:29
Hi @Eazhil Amuthan
welcome to the community.
Unfortunately I couldn´t find any query in the bitbucket API docu that supports a queryParameter called "created_on".
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-get
Could you maybe send information where this is documented?
BestStefan
Thanks @Stefan Salzl for the speedy reply.Here it's listed that we can use created_on to filter some of the following endpoint.What I'm trying to achieve is to fetch all merged PRs between two release branches.If this isn't possible, Is there any other way to achieve it?https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering
ah... thanks for the hint. wasn´t aware of that. I´ll have to experiment with them.
Meanwhile:
Could you tell/show us how you are calling the API/in which way (automation/curl call/...) and what you get as a result/error?
I'm using axios to call the API and I'm not getting any errors but only the state filter ( state = "MERGED") is working
const INITIAL_URL = `https://api.bitbucket.org/2.0/repositories/${workspace}/${repository}/pullrequests?q=state="MERGED"&created_on>2023-11-17T05:11:02`
const fetchAllPRs = async (URL) => { try { const res = await axios.get(URL, { headers: { Authorization: `Bearer ${token}`, } }) return res.data } catch(e) { console.log(e) return null }}
It looks like you're new here. Sign in or register to get started.