It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What the correct way of tagging a build with the Jira version when using Jira's Release with Build Edited

I have finally got around to trying to make the "Release with Build" Jira functionality work with our Bamboo builds for tagging a release. However, I cannot seem to get it to tag the build with the Jira release name/version even though I think I have set things up correctly.

Environment:

  • JIra Cloud
  • Bamboo 7.0.4

I have a Build Plan, with two stages, with the second stage set as a manual stage for "Tag and Release".

Within the second stage, I have a "Repository Tag" Task configured, with the relevant repository, and the Tag name set to "RELEASE-${bamboo.jira.version}".

After triggering the build from Jira, using the "Release with new build" functionality (after working around the very limited build selection by modify the HTML value for the check box to the correct build), the build stage was correctly triggered and ran.

The source was tagged, but the tag name was literally "RELEASE-${bamboo.jira.version}".

Here's an extract from the build log for the manual stage:

simple	24-Jun-2020 20:08:48	Starting task 'Tag the source code with the Jira version details' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.tagging'
simple	24-Jun-2020 20:08:50	Warning: Permanently added '[127.0.0.1]:44649' (RSA) to the list of known hosts.
simple	24-Jun-2020 20:09:15	Git LFS: (0 of 0 files, 85 skipped) 0 B / 0 B, 790.86 MB skipped               
simple	24-Jun-2020 20:09:17	To ssh://127.0.0.1:44649/XXXXX/XXXXXXX.git
simple	24-Jun-2020 20:09:17	 * [new tag]             RELEASE-${bamboo.jira.version} -> RELEASE-${bamboo.jira.version}
simple	24-Jun-2020 20:09:17	Git LFS: (0 of 0 files, 85 skipped) 0 B / 0 B, 790.86 MB skipped               
simple	24-Jun-2020 20:09:17	Finished task 'Tag the source code with the Jira version details' with result: Success
s

As you can see, it created a nice tag, with a not so nice name, and certainly not the intended name.

I should also add that I have other "Repository Tag" Task configured using other Bamboo build variables, and they substitute the variables in without issue.

And now my question: Any ideas what I am doing wrong, or if this functionality works properly?

Thanks,

Robert

1 answer

So after working with Atlassian Technical Support a bit, and doing the logical thing at their suggestion (which I didn't think of) and adding a "Dump variables to log", I discovered the variables are not named as documented when triggering the manual stage.

What I found was that the variables should be named:

bamboo.triggerReason.jiraBaseUrl
bamboo.triggerReason.jiraProjectKey
bamboo.triggerReason.jiraProjectName
bamboo.triggerReason.jiraUserDisplayName
bamboo.triggerReason.jiraUsername
bamboo.triggerReason.jiraVersion
bamboo.triggerReason.jiraVersionId

Once I switch my tag name to use "${bamboo.triggerReason.jiraVersion}" things now behave as expected (ignoring the lack of builds to choose from when triggering).

I'm not sure if this is what Atlassian intends for people to do or not -- hopefully the  support team will let me know soon.

But I'm sharing this information in the hopes that it helps someone else.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Cannot save a repository using Chrome v83 and other Chromium based browsers such as Edge

Hello Bamboo Community, I'm Jey from Bamboo Support team. If you have upgraded your Chrome browser to version 83 recently, it is observed that the save operation just spins and never completes w...

417 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you