hello,
i have create one rule to create labels from pageProperty. in my Test create any variables:
variable: myHtml
{{ page.body.storage.substringAfter("Bereich</p>").substringAfter("<td").substringAfter(">").substringBefore("</td>").replaceAll("(?i)<br\\s*/?>", ",").replaceAll("(?i)</p>\\s*<p>", ",").replaceAll("<[^>]+>", "").replaceAll("\\s*,\\s*", ",").trim }}
Result: Windows 10,Windows 11,Server 2022,Server 2023,Server 2024,Server 2025
Next stept create Cariable make lowerCase:
variable: myWert
{{ myHtml.toLowerCase() }}
Result: windows 10,windows 11,server 2022,server 2023,server 2024,server 2025
Next step, create a string with labels with comma separet
Funktion log:
Variable Split: '{{ myWert.replaceAll(",\\s*", ",").replaceAll(" ", "_").replaceAll("([^,]+)", "bereich_$1") }}'
Result: Variable Split: 'bereich_windows_10,bereich_windows_11,bereich_server_2022,bereich_server_2023,bereich_server_2024,bereich_server_2025'
create Variable: myLabel
{{#myLabelsRaw.split(",")}}bereich_{{.trim().toLowerCase().replace(" ", "_")}}{{/}}
Result:
'bereich_windows_10,bereich_windows_11,bereich_server_2022,bereich_server_2023,bereich_server_2024,bereich_server_2025'
in the next steppt i will create any labels:
bereich_windows_10
bereich_windows_11
bereich_server_2022
bereich_server_2023
bereich_server_2024
bereich_server_2025
how cnn i do, my testcase for this:
function: create label
{{#myLabel.split(",")}}{{.}}{{/}}
result: fail
{{ myLabel }}
result fail
Fail test in german:
can you help me ?
best regard
Bernd
hello,
i found a way to create label with comma separated list
for example: myWert = "Liste 1,Liste 2,Liste 3"
in the branch split this string to
Liste 1
Liste 2
Liste 3
component create variable: myLabel
in next Step eleminate " " and put the text befor "Liste 1"
bereich_{{myLabelTmp.trim().replace(" ", "_")}}
and in last component add label
{{myLabel}}
this is all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bernd Winger ,
I know there's this bug related to automation: AUTO-328: Automation Error: The label 'JIRA AUTOMATION' can't contain spaces. (customfield_xxxx))
As stated in the cause:
- When adding/setting the labels field on an issue through automation, it currently assumes that a smart value will resolve to a single value.
- If you are trying to add multiple labels through automation by assigning values to a label field through a variable, It will resolve the multiple labels into a single value. It is considering the "space" in between the labels and making it a single value and you will end up with the error "The label X can't contain spaces" in the automation audit log.
Not sure if this is strictly related to what you're experiencing (based on the trace ID you've shared), but it's something to keep in mind.
Regarding that support ID, you could share it with the official support team to maybe take a look 👀
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which action are you using as in Automation there is no create label action and there is not API endpoint to create labels.
Also labels can only exist if used or added to a page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.