Hello,
I would like to create the following flow.
user commit and PR a feature, then on the pipeline
=> Lint/Test
=> 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
Hi @federico,
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.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.