Fellow Atlassians!
I'm creating an automation rule that triggers a web hook with a POST request to the Confluence REST API to create a new Confluence page with certain data from an issue.
Everything is working fine (at last!) but as a next step I wanted to add the components of the issue as labels to the Confluence page. Using
"metadata": {
"labels": [
{
"name": "{{issue.components.name}}"
}
]
} I'm succesfully adding the component as a label to the Confluence page for issues only associated with one component, but I'm getting an error when the issue has multiple components.
{"statusCode":500,"message":"java.lang.IllegalArgumentException: Invalid label 'automations & workflows, boards & filters, permissions'"}From the error I'm getting, I'm guessing there's a max characters limit or something for labels in Confluence, but it could also be a formatting error due to {{issue.components.name}} now returning a list, but I have no clue and would appreciate elaborations and duscussions on the matter!
Anyways, in this support documentation page, under "Using smart values with sections and lists" there's a brief mention of
{{#issue.comments}}Author: {{author.displayName}}{{/}} returning the comment authors of a given issue. I've tried this syntax for components, but it doesn't seem to work. I don't understand what the {{#}} {{/}} functionality does, so if someone would like to elaborate on this as well, it would be very appreciated. Could this achieve what I want it to?
Sorry for a lengthy question, I wanted to provide some context to possibly receive input on other solutions and ideas.
Thanks!