Automation - Trying to update fixed version from one issue to another

Kajsa Fransson January 17, 2024

Hi

I have two linked issue (one from JSM project and one Software). Im trying to create an automation between these linked issue where I want to update FixVersions. It works fine for other fields/logic but is it any limitation for FixVersion? 

My latest try was:

fixed version.png

Regards Kajsa

 

 

2 answers

1 accepted

0 votes
Answer accepted
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.
January 17, 2024

Hi @Kajsa Fransson 

Did you notice the typos in your log and comment actions, where they are missing the period after issue?

Kind regards,
Bill

Kajsa Fransson January 17, 2024

I dont understand what you mean? 

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.
January 17, 2024

Your rule image shows this:

{{issuefixVersions.name}}

but it should probably be this:

{{issue.fixVersions.name}}

 

Kajsa Fransson January 17, 2024

Sorry, I have tried this with so many Smart Values now, but the result is the same. I get the comments but no Fixed version. 

kommentar.png

uppdaterad regel.pnglogg.png

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.
January 17, 2024

Please post an image of your current rule and the audit log details showing the entire rule execution.  These may provide some context. 

The way your rule is currently structured, the audit log entry and comment will show the version information for the linked issues and not the trigger issue.  Is that what you intended?

 

Do your issues have one or multiple values in the Fix Version field?

Are all of these issues in one Jira project?

Kajsa Fransson January 17, 2024

Two diffrent project (One from JSM project and one Software). Im mention it above. 

It starts with an issue that creates issue number two via automation. After that, the idea is that some information should be returned to the case that caused it. Including Fixed Version. Right now only comments is created on the original case but not the version tag. I tried updating the field FixVersion directly as well (not using comments). 

The Audit log I didn't have it from the beginning but added it later. I have only tested with one Fix version but the field is supporting several. 

Better?

hela loggen.pngHela regeln.png


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.
January 18, 2024

Thank you for that information.

It seems you are trying to copy the Fix Versions from the trigger issue in one project (e.g., DEV) to the linked issues in another project (e.g., CS).

 

Versions / Releases in each project are different, even when they have identical names.  In each project, the Versions are created with their own unique identifier.  Because of this, I believe the rule would need to use Advanced Edit with JSON (under the edit action's "more options") and add the versions by name, not by id.

Please look here to learn more about the JSON for version fields: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Fix-Versions  You will want to use "add" to add versions to the existing values.

Kajsa Fransson January 19, 2024

ok.

If I use this it works:

"update": {
"fixVersions": [
{
"add": { "name": "2024.3"}

But that is not what I want - I need it to fetch right value.
Like this (which dont work):

"update": {
"fixVersions": [
{
"add": { "name": "{{issue.fixVersions.name}}"}

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.
January 20, 2024

Please post an image of the complete JSON you are using, as what you show is incomplete, and that may explain why it does not work as expected.

Also, I asked earlier if there are multiple versions in the field.  Please let me know if there can be multiple values as the syntax will be different: a field iterator must be used to include an "add" for each value.

Kajsa Fransson January 22, 2024

This one does not work:

automation 22.png

If I replase {{issue.fixVersions.name}} to {"name": "2024.3"} the automation works but the fixes version is not allways 2024.3. 

We are using the standard field for fixed version which is a multiple list. One issue could only have one fixed version, but we have several versions ongoing. 

Fixedversion.png

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.
January 22, 2024

Are you trying to add the fix version from the trigger issue?

For the rule image you show, the edit action is referencing {{issue.fixVersions.name}} inside of the branch to the linked issues.  And so {{issue}} then refers to the linked issues as they are looped over.  Essentially the rule is setting the fix version to the value which is already present.

To set the field to the trigger issue's field try using: {{triggerIssue.fixVersions.name}}

 

============================

{{issue}} can refer to different things depending upon where you are in the rule.  Please see this example below for more details.

  • trigger: some trigger => At this point, {{issue}} and {{triggerIssue}} are the same.
  • action: some action => At this point, {{issue}} and {{triggerIssue}} are the same.
  • branch: to some issues => At this point, {{issue}} and {{triggerIssue}} are the same.
    • action: some other action => At this point, {{issue}} and {{triggerIssue}} are the different.  {{issue}} now refers to each issue branched to as it loops.
  • action: another action => At this point, {{issue}} and {{triggerIssue}} are the same.
Kajsa Fransson January 24, 2024

It dont work to get the field updated BUT it work in that way that I can add fixed version as a comment when using {{triggerIssue.fixVersions.name}}. So then im happy. 

Thank you very much for your help!!

Like Bill Sheboy likes this
0 votes
Sagar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2024

Hi @Kajsa Fransson Does the same fix version value present on both the projects like in JSM and Software project in your case

Kajsa Fransson January 17, 2024

Yes, I have created the same fixVersion in both the project. 

Kajsa Fransson January 17, 2024

The comment is created correct but the fixversion tag is not included. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events