Can I update the Pipeline status in the steps?
Asked by Stefan Balan:

```
branches:
 QA:
  - step:
  # We don't want the default pipeline to trigger this process, so we leave the first step empty
  name: Start building the QA
  status: In Progress ---- Is this Possible or something similar? because I need this to reflect the Status of my Pipeline to come back later and run the other steps remaining in the Pipeline
  script:
    - echo "Building QA in progress..."
  - step:
  # Code review and manually push changes in QA Bitbucket
   name: Build Bitbucket QA
   deployment: QA
   trigger: Manual
   script:
    - echo "Building Bitbucket QA..."
  - step:
  # push changes in QA Salesforce, run Unit tests and UI review
   name: Build Salesforce QA
   trigger: Manual
   script:
    - echo "Building Final QA..."
```


Answers:
author: Theodora Boudale
body: Hi Stefan and welcome to the community.

If you want to monitor which Pipelines have manual steps that haven't run yet (so you can run them later), you can check the Pipelines page in the repo.

If you take a look at the following screenshot from one of my repos:

![Screenshot 2020-12-08 at 13.32.22.png](https://community.atlassian.com/t5/image/serverpage/image-id/121332iB6F99EA28AFE9905/image-size/large?v=v2&px=999 "Screenshot 2020-12-08 at 13.32.22.png")

For Pipeline #27, the icon with a circle within a circle next to the status "Successful", indicates that there are steps that haven't run yet.

For Pipeline #26, the check icon inside the circle indicates that all steps have run.

Can you monitor it this way? Or are you looking for a way to programmatically retrieve this info?

Kind regards,  
Theodora

comments: author: Stefan Balan
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

I was looking to programmatically retrieve this info in my YAML file and change it with a string data, depending on the step I'm in.

Your answer is a start, and much appreciated.

Best Regards Stefan


author: Theodora Boudale
body: Hi Stefan,

Thank you for your reply and you are very welcome.

You mention
> I was looking to programmatically retrieve this info in my YAML file and change it with a string data, depending on the step I'm in.

Could you perhaps explain a bit more about your use case and how this would be useful for you?

The status of the pipeline can be retrieved via an API call and it will show as IN_PROGRESS if there are steps that haven't run yet, and COMPLETED when all the steps have run.

However, if you include such an API call in the yaml file to be executed during the build, the output will always be IN_PROGRESS, even for the final step, as the build is still running when the API call is executed.

While it's not possible to define a variable the way you described in your original post, I'd like to understand a bit better your use case, to see if there is another way to achieve what you'd like.

Kind regards,  
Theodora


author: Stefan Balan
body: Hi Theodora,

My use cases is this, I run multiple steps (3 steps) I need a column in the **Pipelines Table** to mention how many "Steps" completed. And this can be achieve with the following format.

**Status Steps**

[Successfu](https://bitbucket.org/balans001/salesforce-source-control/addon/pipelines/home#!/results/38)l 1/3

**Status Steps**

[Successfu](https://bitbucket.org/balans001/salesforce-source-control/addon/pipelines/home#!/results/38)l 2/3

**Status Steps**

[Successfu](https://bitbucket.org/balans001/salesforce-source-control/addon/pipelines/home#!/results/38)l 3/3

Best Regards Stefan


Tags: bitbucket-cloud

bitbucket-pipelines