Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,637,355
Community Members
 
Community Events
196
Community Groups

Math Operation within Repository Tag Tag Name Possible?

Edited

Is there a way to perform a math operation within the "Tag Name" field when configuring "Repository Tag" task?

For example, I would like to add a git commit tag based on the current Bamboo build number. However, the build number should be subtracted by 5. So something like this:

0.0/0.0.(${bamboo.buildNumber}-5)

and when bamboo.buildNumber is equal to 16, the tag would be 0.0/0.0.11.

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 19, 2022

Hello @Eduardo Wiputra,

Welcome to Atlassian Community!

The "Repository Tag" task will not do mathematical operations whilst tagging a commit.

You can either:

  1. Use a "Script task" and perform the tagging using a shell script + git command
    or
  2. Use a "Script task" to run your maths and create a properties file with a format such as "custom_tag=0.0/0.0.11" then add an "Inject Bamboo variables" task to consume that variable from the properties file you have just created and then use the custom variable in the "Repository Tag" task as "${bamboo.custom_namespace.custom_tag}" -- You have to define the namespace name whilst injecting the custom variable.

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Hello @Eduardo Alvarenga

Thank you very much for the replies! I wasn't aware of "Injection Task" before I asked the question. Since then, I've experimented with it and realized how powerful it can be.

 

Sincerely,

Eduardo

Like # people like this
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 19, 2022

Thank you @Eduardo Wiputra

Suggest an answer

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

Atlassian Community Events