Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation templated description issues

tremby
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!
November 5, 2025

Hi.

I don't have admin access, and I'm trying to get a template updated. It's a painful process -- the admin I'm talking to is busy and non-technical, and each iteration is taking hours or days.

Meanwhile either the documentation is poor or I'm looking at the wrong documentation.

I'm hoping someone here can help us speed this process up.

The situation:

This automation is trigger (I believe) by a new version of our project being added. I'm not sure that's the exact trigger, but the result is to make a new task and some subtasks.

In the task description I want to use the version number in various ways.

Apparently I can't rely on consistency in how the new version number is entered, so I'm trimming a leading v or V, and doing the following to print the version number. This works.

{{version.name.replace("v", "").replace("V", "")

 I get out (for example) 4.12.1

What I want to do next is manipulate that version number.

I thought I was on the right lines with this:

# For a patch version bump:
yarn set-version-number v{{version.name.replace("v", "").replace("V", "").split(".").get(0)}}.{{version.name.split(".").get(1)}}.{{#=}}{{version.name.split(".").get(2)}} + 1{{/}}

# Or for a minor version bump:
yarn set-version-number v{{version.name.replace("v", "").replace("V", "").split(".").get(0)}}.{{#=}}{{version.name.split(".").get(1)}} + 1{{/}}.0

I expect to get:

# For a patch version bump:
yarn set-version-number v4.12.2
# Or for a minor version bump:
yarn set-version-number v4.13.0

But what I actually get is this:

# For a patch version bump:
yarn set-version-number v..1
# Or for a minor version bump:
yarn set-version-number v.1.0
Can someone please tell me what's wrong, and what the correct markup would be?
Secondly, I wanted to nest code blocks in ordered list items. I tried this:
# This is the first item

{code:bash}
this is the code block
still the code block
{code}

# This is the second item

But it is not understood to be part of the same item. It isn't indented with the list item, and the next list item starts over at 1.

I tried including leading spaces on the blank before the code block, but that didn't help.

Is this possible, or not? I can just use headings instead if not.

Thanks.

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2025

Hi @tremby -- Welcome to the Atlassian Community!

Without seeing your entire rule for context, I am assuming your rule trigger is Version Created.  if it is not, your rule will not work as you describe.  Perhaps posting an image of the entire rule and audit log details will help.

Until we see those...

 

Managing / incrementing version numbers with smart value expressions can be tricky, and depends upon your version naming rules.  Some tips to help based on what you show:

  • I recommend always first writing {{version.name}} to the audit log to confirm what is present before attempting the parsing
  • Your extraction of the "4.21.1" seems to work and as it is reused repeatedly.  I recommend storing with the Create Variable Action, perhaps named varOldVersion, for use later as {{varOldVersion}}
  • Perhaps also parse out each part of the version number to allow managing them separately
  • In the later expressions you are not consistently using that expression to remove the "v" characters before the split, potentially leading to problems when you try to use it as a number
  • Most importantly: some characters in the split function can be interpreted incorrectly without escaping.  To solve that for the period . use this
{{someSmartValue.split("\.")}}

 

Putting those together, perhaps try this:

  • trigger: version created
  • action: log
The version created was {{version.name}}
  • action: create variable
    • variable name: varOldVersion
    • smart value:
{{#debug}}{{version.name.toLowerCase().replace("v", "").trim}}{{/}}
  • action: create variable
    • variable name: varMajorNumber
    • smart value: 
{{#debug}}{{varOldVersion.split("\.").get(0)}}{{/}}
  • action: create variable
    • variable name: varMinorNumber
    • smart value:
{{#debug}}{{varOldVersion.split("\.").get(1)}}{{/}}
  • action: create variable
    • variable name: varPatchNumber
    • smart value:
{{#debug}}{{varOldVersion.split("\.").get(2)}}{{/}}
  • Use the variables to combine, increment, decide your new version

 

Pleases note I added {{#debug}} ... {{/}} wrappers to some of the actions to help see the values in the audit log as they are parsed.

 

Kind regards,
Bill

tremby
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!
November 6, 2025

Hi Bill. Thanks for your response.

Escaping the dot seemed the most likely thing, so before trying to get the admin to add extra actions, which I thought might be painful, in our next iteration I had him try with those dots backslash-escaped, and that did the job.

Thank you! Everything related to that is now working correctly.

Still wish I could find a way to nest code blocks in ordered list items. Any idea whether that's possible?

Suggest an answer

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

Atlassian Community Events