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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Edited

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

Hi! 

Which headers do you send? 

headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,930 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you