I am trying to trigger a bitbucket pipeline using the api endpoint, but I am getting the following response:
{
"error": {
"message": "Bad request",
"detail": "bitbucket-pipelines.yml not found.",
"data": {
"key": "result-service.pipeline.yml-not-found",
"arguments": {}
}
}
}
This is the request that I am using. I have verified and this branch has the pipeline and I am able to trigger it manually from pipelines section of the repo.
curl -X POST -is -u username:password \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \
-d '
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "branchname"
},
"variables": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value2"
}]
}'
Hi @Ishan Roy and welcome to the community.
The data you need to send with the request depends on the type of the pipeline you want to trigger.
The documentation below has some examples:
Is the pipeline you want to trigger defined as follows
pipelines:
branches:
branchname:
in the bitbucket-pipelines.yml file of this branch? Or is it perhaps a custom pipeline? In case it's a custom pipeline, you'll need to include some additional fields in the request (you can check the examples in the doc).
We'd need to know in which section of your bitbucket-pipelines.yml file this pipeline is defined in order to figure out how it should get triggered.
Kind regards,
Theodora
Hi @Theodora Boudale, It was a custom pipeline and I was able to trigger the same after adding the selector in the request body. Thanks for the support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the update @Ishan Roy and you are very welcome, I'm glad to have helped!
Please feel free to reach out if you ever need anything else.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Api request working fine from local when we connected with vpn
But we want make request from bitbucket pipeline then it's not working
Because requester(bitbucket pipeline )have different ip not vpn ip
We are using bitbucket host
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.