Forums

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

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

Ganna Koval
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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 Champion
January 1, 2021

Hi! 

Which headers do you send? 

Ganna Koval
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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