getting the custom pipeline name from api within a step

Santiago Bernhardt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 12, 2025

How can we capture the name of the pipeline?

Currently we are doing something like this. But cannot find a way to grab the "custom:pipeline-name"

I cannot believe this is not a native feature...

```

- step: &slack-notification
name: slack-notification
script:
# from the aws-mapping step
- SLACK_WEBHOOK_URL=$(cat ./SLACK_WEBHOOK_URL.txt)
- BITBUCKET_TRIGGERER_USERNAME=$(curl -X GET -g "https://api.bitbucket.org/2.0/users/${BITBUCKET_STEP_TRIGGERER_UUID}" | jq --raw-output '.display_name')

something like what?
- BITBUCKET_PIPE_NAME=$(curl --request GET --url "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_FULL_NAME}/pipelines/%7B${BITBUCKET_PIPELINE_UUID}%7D" | jq --raw-output 'something')

- pipe: atlassian/slack-notify:2.3.1
variables:
WEBHOOK_URL: $SLACK_WEBHOOK_URL
MESSAGE: '":point_right: \`$BITBUCKET_TRIGGERER_USERNAME\` triggered \`$BITBUCKET_PIPE_TYPE\` for \`$EnvironmentName\` from branch \`$BITBUCKET_BRANCH\`"'
```

1 answer

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

Hi @Santiago Bernhardt

Welcome to the community.

Unfortunately, step names are not part of Pipelines variable at the moment.

We do have an existing feature request for it that can be located through this link. - https://jira.atlassian.com/browse/BCLOUD-23102
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.

As a workaround, you can try the solution mentioned in this KB article: Obtaining Step Names as Environment Variables in Bitbucket Cloud Pipelines

Regards,
Mark C

 

Suggest an answer

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

Atlassian Community Events