Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket cloud api run pullrequest pipeline build

Alexandr Marchenko
Contributor
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
atlassian, bitbucket, ci/cd workflows, scale ci cd, bitbucket webinar, devops pipeline, continuous integration, continuous delivery, atlassian learning, software automation, developer tools, build and deploy, pipeline optimization, atlassian community

Scale CI/CD workflows faster with Bitbucket Pipelines 🪣

Join this webinar on June 25/26th to learn how to build secure CI/CD workflows using Bitbucket Pipelines and get tips from our own engineers on how to speed up builds and operate at scale.

Register today
AUG Leaders

Atlassian Community Events