I would like to know if there is a running bitbucket pipeline. To do that, I'm trying to get all pipelines with the status "in progress", using the API.
I found the query to list all pipelines here. And I've found this answer on the forum, using the filtering tools spec here but I can't make it work.
I've tried this very simple query:
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/<myWorkspace>/<myRepository>/pipelines?status!=COMPLETED' \
--header 'Authorization: Bearer <myToken>' \
--header 'Accept: application/json'
But it outputs pipelines in "completed" state:
{
"page": 1,
"values": [
{
"uuid": "{xxxxxxxxxxxxxx}",
"repository": {
...
},
"state": {
"name": "COMPLETED",
...I've also tried by providing the full path to the "name" property without success.
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/<myWorkspace>/<myRepository>/pipelines?state.name!=COMPLETED' \
--header 'Authorization: Bearer <myToken>' \
--header 'Accept: application/json'
What am I doing wrong?