In our setup we have created a Jira Project Automation which does the following:
Trigger: When a release is created then it does:
* Notify us on MS teams
* Send a web request to one of our Bitbucket repos to tag and build a specific pipeline
* In the end of the the pipeline it calls back to a webhook in Jira Project Automation which then triggers a new pipeline in another pipeline/repo. (This continues until all need pipelines are build in the specified order).
The setup is as described in https://en.jodocus.io/trigger-bitbucket-pipelines-with-jira-cloud-automation/
Currently we have setup the bitbucket API to authorize using Basic auth using the key as
base64encoded(user:app password), where the app password is tied to one of our users.
We would like to use a authorization method which is not tied to a specific user, but rather to our organization - however it seems such an APP password does not exist for the organization. The closest thing to this I would say would be OAuth Consumers, but this would then require an extra call to get a token as I see it and complicate the Webhook call. I have been able to get a token using:
curl -X POST -u "key:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials
But I can't figure out how to get the token into the following webhook call to bitbucket.
So the question is: is there a better way to trigger the pipeline builds in bitbucket from jira?