Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What is wrong to create pipeline schedule ?

I requested: 

curl -X POST \
--user ${myUserID}:${myPassword} \
--header 'Content-type: application/json' \
https://api.bitbucket.org/2.0/repositories/${myWorkSpace}/${myRepository}/pipelines_config/schedules/ \
--data '{
"type": "pipeline_schedule",
"enabled": true,
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "develop",
"selector": {
"type": "custom",
"pattern": "laravelTestOnDemand"
}
},
"cron_pattern": "0 25 9 * * 1-5 *"
}'

 

Then response: 

{"error": {"message": "Bad request", "detail": "Response Summary: HttpResponseSummary{httpStatusCode=422, httpStatusMessage=Unprocessable Entity, bodyAsString={\"errors\":[\"expression is not valid\"]}}", "data": {"key": "trigger-service.schedule.schedule-creation-failed", "arguments": {}}}}

 

Please  help me.

 

refs:

https://ja.confluence.atlassian.com/bitbucket/scheduled-pipelines-933078702.html
- https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines_config/schedules/#post

2 answers

1 accepted

0 votes
Answer accepted

Hi Hisashi-san,

It seems cron_pattern is not valid expression. Could you try to regenerate correct one using freeformatter.com ?

"cron_pattern": "0 25 9 * * 1-5 *"

Thanks for reply. 

I tried, but same result.

・・・
--data '{
"type": "pipeline_schedule",
"enabled": true,
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "develop",
"selector": {
"type": "custom",
"pattern": "laravelTestOnDemand"
}
},
"cron_pattern": "25 9 * * 1-5"
}'

{"error": {"message": "Bad request", "detail": "Response Summary: HttpResponseSummary{httpStatusCode=422, httpStatusMessage=Unprocessable Entity, bodyAsString={\"errors\":[\"expression is not valid\"]}}", "data": {"key": "trigger-service.schedule.schedule-creation-failed", "arguments": {}}}}
~

 

スクリーンショット 2020-07-29 18.09.35.png

Sorry, I not mentioning JSON format it's about cron format.

Screen Shot 2020-07-29 at 18.17.53.png

Please generate correct cron format e.g. 25 9 * ? * * *

Like Hisashi SOGA likes this

Thanks! 

Setting is successful. 

I used "0 25 9 ? * MON,TUE,WED,THU,FRI *" to cron_pattern. 

スクリーンショット 2020-07-30 10.02.05.png

 Glad to help!

Note: The time zone must be taken into account.

If you want to set it to 9:15 JST, 

 

x "0 15 9 ? * MON,TUE,WED,THU,FRI *"

o "0 15 0 ? * MON,TUE,WED,THU,FRI *"

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

156 views 2 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you