You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I would like to create the following flow.
user commit and PR a feature, then on the pipeline
=> Build a preview
=> Deploy a preview
=> Automatically comment on ticket with preview link and move to QA.
I am unsure how to achieve this last step.
I am using Bibucket Cloud and Jira and probably would use Smart Commit .
The question is, how can I retrieve the ticket number from the pipeline ? I know there is some variables, but none seems related to the Jira Ticket. I would like to be able to retrieve this from the `bitbucket-pipelines.yml` the same way the PR page can know the associated tickets.
Is it possible ?
Thank you for reaching out to the community.
For the last step in your workflow, I don't think there's a default variable in Pipelines that fetches a Jira issue link. - Bitbucket Pipelines variables
As a workaround, since there is the default variable BITBUCKET_COMMIT in Pipelines, you can run a Git command to show extract the commit's message.
From that commit message, you can then parse the result to get the Jira issue key given the commit message has an issue key.
# To get the commit's message - export commit_message=$(git show -s --format=%B $BITBUCKET_COMMIT) # Parse the variable *commit_message* to get the Jira issue key
Hope it helps.