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

Why receive Bad request "result-service.pipeline.yml-not-found" for triggering pull request

Ganna Koval December 31, 2020

I need to trigger a pull request pipeline. First, I get a list of open pull requests by 

/2.0/repositories/{workspace}/{repo_slug}/pullrequests?state=OPEN

And then in loop I put necessary information from response to payload for triggering a pull request pipeline

issues = json.loads(getResponse.text)['values']
for issue in issues:
id=issue['id']
source = issue['source']
destination = issue['destination']
payload=json.dumps({
"target": {
"type": "pipeline_pullrequest_target",
"source": "pull-request-branch",
"destination": destination['branch']['name'],
"destination_commit": {
"hash" : destination['commit']['hash']
},
"commit": {
"hash" : source['commit']['hash']
},
"pullrequest" : {
"id" : str(id)
},
"selector": {
"type": "pull-requests",
"pattern": "VR-*"
}
}
})

So, my payload is like:

{
"target": {
"commit": {
"hash": "311349281708"
},
"destination": "develop",
"destination_commit": {
"hash": "c6da67fa6551"
},
"pullrequest": {
"id": "66"
},
"selector": {
"pattern": "VR-*",
"type": "pull-requests"
},
"source": "pull-request-branch",
"type": "pipeline_pullrequest_target"
}

I send it by 

/2.0/repositories/{workspace}/{repo_slug}/pipelines/

 

 And in response I get:

 "error": {
"data": {
"arguments": {},
"key": "result-service.pipeline.yml-not-found"
},
"detail": "bitbucket-pipelines.yml not found.",
"message": "Bad request"
}

My  bitbucket-pipelines.yml is :

pull-requests:
VR-*:
- step: *quality-gate-setup
- step: *quality-gate-run
VRS-*:
- step: *quality-gate-setup
- step: *quality-gate-run
release-*:
- step: *quality-gate-setup
- step: *quality-gate-run

 

1 answer

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 1, 2021

Hi! 

Which headers do you send? 

Ganna Koval January 3, 2021
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events