Hi all.
I'm trying to access the Affect Versions field in JSD support ticket and post it in a Slack notification.
Using the smart values and reading the document here: https://support.atlassian.com/jira-software-cloud/docs/use-smart-values-to-access-listed-values/
My automation rule log is not able to pick up the value in the Affect Versions field.
Using the REST API browser I can see the following:
"versions": [{"self": "https://my-domain.atlassian.net/rest/api/3/version/14214","id": "14214","name": "1.9.0","archived": false,"released": true,"releaseDate": "2020-06-03"}],
I thought that the smart value will be {{versions.name}}, but since this is an array, I was trying to use
{{issue.versions.name.join(", ")}}
or
{{#issue.versions}}{{name}} {{/}}
but nothing seems to pick up the version name from that array.
Appreciate your help.
Just for other community members benefit, posting the answer I have provided to Gil in Support ticket.
This is how we can get version name and release date values from Affects Versions system field using smart values.
To get the version name, use:
{{issue.versions.first.name.asJsonString}}
And for version release date:
{{issue.versions.first.releaseDate}}
Screenshot:
If you want to get rid of double quotes from version name, use:
{{issue.versions.first.name.jsonEncode}}
Hey there Gil,
Most of our smart values matches the data returned through REST for the issue, i.e. through /rest/api/2/issue/ISSUEKEY-1?expand=names,renderedFields,changelog
More specific examples can be found at:
https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/
In your specific case, the right field name is actually version not versions so, for affects versions, you should be able to do:
{{issue.version.name}}
And it will concatenate the affect versions.
Cheers,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer.
According to your documentation, the examples listed there use the value Versions and not Version.
See:
(source: the link you provided)
So which one is it? Do you need to amend your documentation?
---
Whether it's Version or Versions, given the Affect Versions is a list, would this be a correct way to do this?
{{#issue.versions}}{{name}} {{releaseDate}}, {{/}}
Or is this the correct way?
{{#issue.versions.name}} {{releaseDate}}, {{/}}
Update:
I tried all of these combinations and none of them work:
Version: {{issue.version.name}} | {{issue.versions.name}} | {{issue.version}} | {{versions.name}}
The LOG returned empty results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah sorry, my bad. Looks like we've got wrong and right documentation on that page.
We'll get that fixed up
---
{{#issue.versions}}{{name}} {{releaseDate}}, {{/}}
This is the correct style (the # sets the object as the main object inside that context)
We do some smart defaults so if you want a simple value we auto-concatenate the strings, so {{issue.versions.name}} will output Version 1, Version 2
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.
I tried this whole weekend to get the log to show the Affects Versions.
Can I please get your assistance on this one?
See my above screenshot. It is empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey there Gil,
Sorry to hear... That smart value works fine for me so it's probably something specific here. Does outputting {{issue.versions}} show anything? Is your issue using the system Affects Versions or is it a custom field of type version?
Can you raise a support request at https://getsupport.atlassian.com/ and we can check it out on your instance.
Cheers,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank @Mark Chaimungkalanont
Raised PCS-17865
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cool I'll follow up there. Looks like a weird one
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.