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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,589 views 1 9
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