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

Bitbucket API pipeline states

plussier 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

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events