Hello,
I'm trying to build an automation to update the label with the assignee display name-HI when the assignee is changed. Since labels do not accept spaces, I need to use the advanced fields (https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/ and https://confluence.atlassian.com/jirakb/automation-for-jira-fails-to-copy-components-list-to-label-with-error-message-the-label-contains-spaces-which-is-invalid-1072473388.html) .
So, if I assignee an issue to a user named First Last, I'd like the label to be FirstLast-Hi
I have attempted dozens of configurations , but always get an error. I am hoping someone can assist in getting this to work:
{
"update": {
"labels": [{
"add": "{{assignee.displayName.remove(" ").concat("-RH")}}"
}]
}
Here's the error:
Error editing issues: (Field labels cannot appear in both 'fields' and 'update')
Thank you in advance!Allison
Hi @Allison
I noted that you have nested double-quoting in your update, due to formula usage. Have you tried to work around that by switching to single-quotes inside?
"add": "{{assignee.displayName.remove(' ').concat('-RH')}}"
Or, you could save the right-side value to a created variable and then use that one.
Best regards,Bill
Thank you for your reply, Bill!
I attempted to replace the double quotes with single quotes and still had the same result. (Field labels cannot appear in both 'fields' and 'update')
Taking the next step of your advice, I tried to remove the second value/calculation and had the same result.
It seems the syntax is correct, so I'm stumped! Thanks so much for the help!
Fascinating...It appears that concat() will not work with single quotation marks.
So one workaround is to put this in a created variable and then set the labels to it:
{{issue.assignee.displayName.remove(" ").concat("-RH")}}
To set the labels to the smart value from the created variable (e.g. let's say we named it varAssigneeLabel
Thanks Bill! Is this feature available in Jira Server? From what I see you posted on another article, it seems I may be out of luck on the workaround, too. https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Create-variable-New-component/ba-p/1448118
It looks like you're new here. Sign in or register to get started.