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.0But 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# 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.
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:
{{someSmartValue.split("\.")}}
Putting those together, perhaps try this:
The version created was {{version.name}}
{{#debug}}{{version.name.toLowerCase().replace("v", "").trim}}{{/}}
{{#debug}}{{varOldVersion.split("\.").get(0)}}{{/}}
{{#debug}}{{varOldVersion.split("\.").get(1)}}{{/}}
{{#debug}}{{varOldVersion.split("\.").get(2)}}{{/}}
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.