Forums

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

Access the latest added version added to an issue via smart value

yaron
Contributor
October 30, 2022

Hello,
I have a case where I need to save the latest version added\ removed rom the multi select fixVersion field.
My problem - I can't find a way to access via smart value the latest added release to the fixVerison field.
{{issue.fixVersions.name}} - returns all the versions mapped to the issue orders by the version id. 

3 answers

0 votes
Inactive Stephen
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.
March 2, 2024

I found this question whilst also trying to find this answer.

I found this article on fieldchange useful - https://confluence.atlassian.com/automationkb/capturing-added-and-removed-values-from-multi-picker-field-in-jira-cloud-automation-rules-1252330496.html

Ste

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.
October 30, 2022

Hi @yaron 

Please take a look at the {{fieldChange}} and {{changelog}} smart values to do that: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

Kind regards,
Bill

yaron
Contributor
October 30, 2022

Hi @Bill Sheboy -
Thanks for the advice but field.Change and changelog are not supporting list fields:
https://jira.atlassian.com/browse/JIRAAUTOSERVER-207

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.
October 30, 2022

Thanks @yaron 

I recall this did work in the past as I have an example rule that previously worked for this (early last year, I believe).

Further testing shows this to be quite "wonky", as the {{toString}} does work only when you add a new version as part of the issue's field edit!  I noted that in the defect to give the devs something to ponder.

yaron
Contributor
November 6, 2022

{{#changelog.Fix Version}}{{fromString}}{{/}} -

  • Add version - return empty.
  • Delete version - return name of the latest deleted version from the ticket.

{{#changelog.Fix Version}}{{toString}}{{/}}

  • Delete version - return empty.
  • Add version - return name of the latest added version to the ticket.
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, 2022

The smart value for that field is fixVersion or "Fix versions".  Smart values are name, spacing, and case-sensitive.

0 votes
Jack Brickey
Community Champion
October 30, 2022

Hi @yaron ,

I just setup the below automation and it successfully captured the most recent Fix version.

67A58AD1-5810-4B1D-807C-C01AF1B5A039.jpeg

The smart value text is...

{{issue.fixVersions.name}}

Jack Brickey
Community Champion
October 30, 2022

Here is a screenshot where the comment action correctly shows only the latest version.

B5EBDA5F-D409-40FE-9282-2EADA3E7A5A9.jpeg

yaron
Contributor
October 30, 2022

Hi @Jack Brickey 
Please note it printed both versions, not only the latest one added (this is my problem):
Screenshot 2022-10-30 144417.png

Jack Brickey
Community Champion
October 30, 2022

Lol...you are correct. I totally missed that. 😖

Jack Brickey
Community Champion
October 30, 2022

Try this...

{{issue.fixVersions.last.name}}

yaron
Contributor
November 6, 2022

last return the latest version in the field based on the release id and not based on the latest added.

Jack Brickey
Community Champion
November 6, 2022

Yes I see, the FV field reorders the entries automatically which results in the latest always being last. 🫤

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