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

Bitbucket cloud api run pullrequest pipeline build

Alexandr Marchenko July 13, 2019

Docs missing example of how to run pipeline for a pull request.

Something like:

curl -X POST -s -H "Authorization: Bearer $access_token" -H "Content-Type: application/json" "https://api.bitbucket.org/2.0/repositories/$USERNAME/$REPOSITORY/pipelines/" -d '{ "target": { "type": "pipeline_pullrequest_target", "source": "feature/foo", "destination": "master" } }'

Returning:

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

 wondering if anyone were able to run pipeline for a pullrequest

1 answer

0 votes
Peter Plewa
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 2, 2019

Hi @Alexandr Marchenko

You can definitely run a pipeline for pull request. Those get triggered automatically on any existing Pull Request updates, but if you rerun any of existing one you can see what the expected parameters are. It doesn't seem to be documented so you'd have to try few combinations to find required parameters.

I've managed to trigger new PR pipeline with similar structure:

{
"target": {
"type": "pipeline_pullrequest_target",
"source": {BRANCH},
"destination": "master",
"destination_commit": {
...
},
"pullrequest": {
...
},
"selector": {
"type": "pull-requests",
"pattern": "**"
},
"commit": {
...
}
}
}

Thanks,
Peter

Roman Borysenko January 24, 2020

What do you mean by "but if you rerun any of existing one you can see what the expected parameters are"? How to see them?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events