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

Bitbucket API deployments environment trigger

Olmo Buining April 16, 2019

I've been using Jenkins for a while now, and I am triggering builds failure and success by calling the API from a script. With the Deployments feature of Bitbucket you can specify which environment a commit is deployed on, I was trying to find an API endpoint for this. is there any API that I could call? or any solution to still tell Bitbucket which commit is deployed where?

 

I'd love to use this feature if it exists so people can see it in JIRA!

 

Thanks in advance

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 9, 2019

Hello Olmo,

EDIT:

The Deployments REST API is available publicly. My mistake. You can view it here

The Step object in the Pipelines API will contain a reference to the environment if it is a deployment step. So that information may help you too.

Have a look at the Jira integration I mentioned originally, as that may still satisfy your use-case: https://confluence.atlassian.com/bitbucket/integrating-jira-and-pipelines-965559953.html

OLD RESPONSE:

Currently the Deployments REST API is not publicly available. If you'd like, you can open a feature request to support the API publicly.

In regards to Jira, do you means exposing which commits and issues are deployed to specific environments. We've released some Jira integrations which may be of interest to you. Have a look here: https://confluence.atlassian.com/bitbucket/integrating-jira-and-pipelines-965559953.html

Thanks,

Phil

Olmo Buining May 10, 2019

Thank you for your reply! 

I've tried to use the Deployment REST API, sadly I couldn't figure out what it does or what to send it.

My flow with posting to environment changes:

1. Calling to get all environments: '/{{workspace}}/{{repo}}/environments/'
2. Get the a specific UUID, just to confirm: '/{{workspace}}/{{repo}}/environments/{UUID}'

3. Using the URL '/{{workspace}}/{{repo}}/environments/{UUID}/changes/' I could POST something, but the documentation wasn't clear on what to send or what the endpoint does.

After this flow I get back 'There was an error processing your request. It has been logged (ID 7eb95f3ffeefdfa4).'

 

Maybe I am looking at the wrong place. I found also this deployments api part ( https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/deployments ) but this only had GET endpoints and nothing to change deployments or which commit has been deployed to which server.

Is there a way to tell through the API that, commit X has been deployed on environment Y? 

 

Your Jira example link is exactly what I would like to achieve without using pipelines. To have Releases Production with a green flag in Jira in the issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events