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

Running Pull request Pipeline over API

Roman Borysenko January 24, 2020

Hi guys!

 

I'm trying running Pull request Pipeline over API (/2.0/repositories/{workspace}/{repo_slug}/pipelines/), but keep having errors like:

{"code": 500, "message": "There was an error processing your request. It has been logged (ID 68d1ff2ffa3a61ad)."}
{"error": {"message": "Bad request", "detail": "bitbucket-pipelines.yml not found.", "data": {"key": "result-service.pipeline.yml-not-found", "arguments": {}}}}
{"code": 500, "message": "There was an error processing your request. It has been logged (ID e62e45d4cddd8672)."}
{"code": 500, "message": "There was an error processing your request. It has been logged (ID 932972b1d66d01f1)."}
{"code": 500, "message": "There was an error processing your request. It has been logged (ID b66f07a503a3ce8c)."}

 

The payload I send is this:

 

data = {
"target": {
"type": "pipeline_pullrequest_target",
"source": "feature/test-1",
"destination": "master",
"selector": {
"type": "pull-requests",
"pattern": "**"
},
}
}

 

And target repo bitbucket-pipelines.yml:

image: python:3
pipelines:
pull-requests:
'**':
- step:
caches:
- pip
script:
- pip install --upgrade pip
...
 

 

It looks like it's not documented, but there are some references people are using it. 

Please help me to get it working...

1 answer

0 votes
mkleint
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 11, 2020

I've managed to make it work with the following payload on my sample repository.

{
"target": {
"type": "pipeline_pullrequest_target",
"source": "pull-request-branch",
"destination": "master",
"destination_commit": {
"hash" : "9f848b7"
},
"pullrequest" : {
"id" : "3"
},
"selector": {
"type": "pull-requests",
"pattern": "**"
},
"commit": {
"hash" : "1a372fc"
}
}
}

I will add a new sample for pull request pipelines in the REST documentation.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events