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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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
T_ Suzuki Atlassian Team Jul 29, 2020

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

T_ Suzuki Atlassian Team Jul 29, 2020

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

T_ Suzuki Atlassian Team Jul 29, 2020

 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 Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

73 views 4 5
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