Scheduling Pipeline using API getting error

gaurav pant July 23, 2020

Request:-

 

curl -X POST -is -u UID:PWD \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/test/REPO1/pipelines_config/schedules/ \
-d '
{
"uuid": "f71d6da2-88b8-471c-b0e3-f03b9d881dc0",
"enabled": "true",
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "sonar"
},
"selector": {
"type": "custom",
"pattern": "sonar"
},
"cron_pattern": "15 * * * *"
}'

 

Getting 500 error:-

 

{"code": 500, "message": "There was an error processing your request. It has been logged (ID dc52f8890d3b9350)."}

 

 @Daniel Santos Can you please check this once?

1 answer

1 accepted

0 votes
Answer accepted
gaurav pant July 23, 2020

Works fine by replacing te json payload by below:-

{
"type":"pipeline_schedule",
"uuid":"{714a83a6-9064-495e-97ce-db28e3848a87}",
"enabled":true,
"target":{
"type":"pipeline_ref_target",
"ref_type":"branch",
"ref_name":"test",
"selector":{
"type":"custom",
"pattern":"sonar"
}
},
"cron_pattern":"15 * * * * ? *",
"created_on":"2020-07-23T15:17:10.661Z",
"updated_on":"2020-07-23T16:32:11.13Z"
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events