In some previous steps, I perform a web request to Jira's API. The data I get back is okay.
{{#webhookResponse.body.issues}} | {{key}} | {{fields.summary}} | {{fields.customfield_12930}} | {{/}}
Now I want to provide this to a PUT to update a field:
{
"fields" : {
"description" : {{#webhookResponse.body.issues}} | {{key}} | {{fields.summary}} | {{fields.customfield_12930}} | {{/}}
}
}
I need to asJSONString quote the {{#webhookResponse.body.issues}}...{{/}} section as wrapping in "" would break if the content includes quotes.
Neither {{#webhookResponse.body.issues.asJsonString}} or {{#webhookResponse.body.issues}}...{{/webhookResponse.body.issues.asJsonString}} works.
So how do I wrap {{#webhookResponse.body.issues}} in asJsonString?
This seems like an easy question... not sure why it's eluding me!
To answer my own question, I believe it's possible to do this with list.join("\n").asJsonString
Jira smart values - lists | Cloud automation Cloud | Atlassian Support
I'll update when I get a chance.
Hi!
Another option might be to use the Create Variable action. Use that to build up the description text and then in the payload you can just treat it as a plain string e.g. {{newDescription.jsonEncode}}.
Also not sure if you are using the "Additional fields" on the edit issue action or sending a new web request, but if you are using the edit issue action you can just use the built-in description fields instead and it should handle all of that for you.
Cheers,
Brydie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah yes, I could just use that. It'd be much simpler.
If only DC was at feature parity for Automation in Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.