In https://confluence.atlassian.com/automation/jira-smart-values-json-functions-993924865.html, there are functions for returning items from issues using the asJsonStringArray (or asJsonArray.
However, I am trying to use this information inside an email that I am sending out as part of an Automation function.
For example,
{{issue.customfield_10106.id.asJsonStringArray}}
appears in the email as
["475","476"]
What I'd like is to have just the 476 retrieved from the Smart value. I've tried:
{{issue.customfield_10106.id.asJsonStringArray[0]}}
{{issue.customfield_10106.id.asJsonStringArray[1]}}
which I would have hoped would retrieve the "475" (0-based array) and the "476".
But, I get nothing but blank lines.
I've tried other ideas, but to no avail. For example, issue.customfield_10106 is a JSON array of approval objects. "id" is the approval number. (475 or 476) for the same issue (it was approved, then reinjected to the point of waiting for a second approval after "additional work" was done (this was a test). So, I've also tried to access the specific approval item, e.g., {{issue.customfield_10106[0].id}} which failed as well.
The point ultimate need is for the last of the list to be accessed (in this example, 476).
If you look at the REST API result for Get of the test issue, you get this (I've collapsed unnecessary sub fields):
Any suggestions from anyone on how I can get access to the specific ID?
Well, solved my own problem by digging into https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html
using
{{issue.customfield_10106.last.id}}
gave the answer of 476.
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.