The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket API pipeline states

plussier
Contributor
December 19, 2022

Hi All,

I recently wrote a quick python script to trigger our Bitbucket pipelines from our Jenkins builds. One of the things I found frustrating was the lack of useful documentation for the bitbucket API around pipelines.  The basic APIs were documented adequately for the most part, but the return values of any given API call were basically all missing (for example, go to Bitbucket Pipeline API -> Get a pipeline  and and then click on the Response Object "Pipeline", and keep following it down to "state". You get nothing!)

 

Interestingly, the best documentation I found was a github repo where someone seems to have created a python client based on the Open API spec for Bitbucket. They don't list all the return states anywhere either, but they have stubbed out the classes for the everything with somewhat useful comments about the various states of both pipelines and pipeline steps.

To help others who may need to do something similar in the future, here's the github repo, and a list of pipeline and pipeline step states:

Github repo: https://github.com/magmax/atlassian-openapi/blob/master/spec/bitbucket.yaml 

 

Pipeline states:

COMPLETED
ERROR
EXPIRED
FAILED
IN_PROGRESS
PAUSED
PENDING
RUNNING
STOPPED
SUCCESSFUL

Pipeline Step States:

COMPLETED
ERROR
EXPIRED
FAILED
IN_PROGRESS
NOT_RUN
PENDING
READY
STOPPED
SUCCESSFUL

I may have missed some, I'm not entirely sure. I compiled these lists by grepping through the models/* directory for state info.

Hopefully someone finds this info useful.

--

Paul

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Bob Swift {Appfire}
Contributor
August 1, 2024

Following this spec: https://api.bitbucket.org/swagger.json you get:

 
public enum PipelineState {
PENDING("pipeline_state_pending"),
IN_PROGRESS("pipeline_state_in_progress"),
COMPLETED("pipeline_state_completed"),
IN_PROGRESS_STAGE("pipeline_state_in_progress_stage"),
RUNNING("pipeline_state_in_progress_running"),
PAUSED("pipeline_state_in_progress_paused"),
COMPLETED_RESULT("pipeline_state_completed_result"),
ERROR("pipeline_state_completed_error"),
FAILED("pipeline_state_completed_failed"),
STOPPED("pipeline_state_completed_stopped"),
EXPIRED("pipeline_state_completed_expired"),
SUCCESSFUL("pipeline_state_completed_successful");

public enum PipelineStepState {
PENDING("pipeline_step_state_pending"),
READY("pipeline_step_state_ready"),
IN_PROGRESS("pipeline_step_state_in_progress"),
COMPLETED("pipeline_step_state_completed"),
ERROR("pipeline_step_state_error"),
FAILED("pipeline_step_state_failed"),
STOPPED("pipeline_step_state_stopped"),
NOT_RUN("pipeline_step_state_not_run"),
EXPIRED("pipeline_step_state_expired"),
SUCCESSFUL("pipeline_step_state_successful");

 

TAGS
AUG Leaders

Atlassian Community Events