You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello everyone,
I'm attempting to create a schedule for one of my repositories pipelines using this request:
curl -X POST -u '$USER:$PASSWORD' \
https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO/pipelines_config/schedules/ \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"type": "pipeline_schedule",
"enabled": true,
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "stage"
}
},
"cron_pattern": "45 23 28 * *"
}'
However I keep getting this response:
{"error": {"message": "Request entity cannot be processed", "detail": "Unexpected response body", "data": {"key": "unexpected.response.body", "arguments": {}}}}
Does anyone have an idea of what I'm doing wrong?
Thank you
Okay was talking to Bitbucket support in a ticket I submitted and with their guidance I was able to get this to work:
1. The Pipeline Schedules use an extended cron format (this is not documented in the API reference):
sec min hour day-of-month month day-of-week year
2. You need to use the "?" symbol instead of the "*" when leaving day-of-month or day-of-week blank
Armed with that knowledge the following request actually works and creates a pipeline schedule that runs at 4:45 UTC on the 28th day of every month
curl -X POST -u '$USER:$PASSWORD' \
https://api.bitbucket.org/2.0/repositories/$WORKSPACE/$REPO/pipelines_config/schedules/ \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"type": "pipeline_schedule",
"enabled": true,
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "stage"
}
},
"cron_pattern": "0 45 4 28 * ? *"
}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.