We have a JSM project where we collect issues from clients. When an agent can't resolve an issue, it is passed to a developer to take a look. If the developer finds a bug, they create a JS ticket and link it back to the JSM ticket.
I'm attempting to copy labels from the JSM ticket to the JS ticket when the link is made, then if the JSM ticket's labels are updated, have the JS ticket's labels be updated as well. I'm doing this with Automation for Jira.
I can do the first portion of that; copy labels when links are made.
The second portion is tricky. I've found where I can get a list of labels from the linked issues via smart values, and I can return them using the audit log action

In order to extract the labels from the JSM ticket so they can be added to labels on the JS ticket, I need to do this {{#issue.labels}}"{{.}}"{{^last}},{{/}}{{/}} to get the labels surrounded by double quotes and comma-separated. Otherwise it gets the list of labels as a single label and throws an error about spaces not being allowed in labels.:

The part that appears to be tripping me up is when I'm editing labels using the More options section of the Edit issue action.

I'm attempting to pass this into the More options field:
{
"update": {
"labels": [
{
"add": ""{{#issue.labels.issuelinks.inwardissue.labels.asJsonStringArray}}"{{.}}"{{^last}},{{/}}{{/}}""
},
{
"add": ""{{#issue.labels.issuelinks.outwardissue.labels.asJsonStringArray}}"{{.}}"{{^last}},{{/}}{{/}}""
}
]
}
} I keep getting this in it the audit logs:

I've tried using single quotes to surround the entire value and I've tried only using one set of double quotes to surround the entire value with no success.
Any help here with properly formatting the JSON would be great!