Give the following request:
curl -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"type": "pipeline_schedule",
"enabled": false,
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "<my-branch-name>"
}
},
"cron_pattern": "0 0 0 1 * ? *"
}' -u "${BITBUCKET_USERNAME}:${APP_PASSWORD}" 'https://api.bitbucket.org/2.0/repositories/<workspace>/<slug>/pipelines_config/schedules/'
I would expect the new schedule to be disabled ("enabled": false). It, however, creates a schedule which is enabled. See the following response:
{
"type": "pipeline_schedule",
"uuid": "{cb5016c2-d127-4469-bc56-c19e6f328829}",
"enabled": true,
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "<my-branch-name>"
}
},
"cron_pattern": "0 0 0 1 * ? *"
"created_on": "2022-11-29T10:52:01.984438Z",
"updated_on": "2022-11-29T10:52:01.984438Z"
}
Hello @Sander Mol ,
Thank you very much for reporting this to us.
I confirmed that this endpoint is currently ignoring the value of the enabled field, so I went ahead and created the following bug in our public issue tracker :
I would suggest you to add your vote there, since this helps both developers and product managers to understand the impact. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all bug fixes are implemented with this policy in mind.
While the issue is not fixed, you can try the below workaround :
- The response of Create a schedule endpoint will contain the UUID of the created schedule.
- With that UUID, use the Update a Schedule endpoint to update the value of enabled to false :
curl -X PUT -u username:app_password -H 'Content-Type: application/json' -H 'Accept: application/json' 'https://api.bitbucket.org/2.0/repositories/<workspace>/<repo_slug>/pipelines_config/schedules/%7B<UUID>%7D' -d '{ "enabled": false }'The %7B and %7D are the encoded values of "{}" that are present in the UUID
Thank you, @Sander Mol !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.