Query wrt BITBUCKET_STEP_RUN_NUMBER

Shubham February 19, 2025

I have one query wrt this BITBUCKET_STEP_RUN_NUMBER variable

I went through this already.

There are some steps configured as deployment, where after running the step, we again get an option to trigger re-deploy like below.

In below case also, will this variable increment if I re-deploy?

I can trigger that re-deploy multiple times, Will increment every time?

Or will it increment in case of failed step only?

 

Also, How can I know in current run about previous run if it failed or if it was success in case of re-deploy? Is there any API for this?

 

Screenshot 2025-02-19 at 4.08.10 PM.png

variable

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 20, 2025

Hi @Shubham 

I've just tested this on my end—that variable will increment upon re-deploy regardless of whether the step failed or was successful.

You can find if the pipeline has been re-run or not by using this API: Get a pipeline

curl -X GET -u  username:app_password 'https://api.bitbucket.org/2.0/repositories/<workspaceID>/repo/pipelines/%7B<REPLACE_WITH_PIPELINE_UUID>%7D'

You will need to replace those placeholder values in the command above wrapped in <> with actual values.

I hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events