Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
Severity 3 - Minor
Description
Problem Statement:
Automation for JIRA throws errors when using variables to capture Label values, performing actions on the values fetched(Eg: Converting to Uppercase), and then adding it back to a Label field.
How to Reproduce:
AUTOMATION RULE:
Trigger: Issue Created Then: Create Variable = Upper Upper = issue.fields.customfield_xxxx.toUpperCase() And: Edit Issue Fields: customfield_xxxx = Upper
ERROR:
Edit issue
Error editing issues
Proj-xxxx (The label 'JIRA AUTOMATION' can't contain spaces. (customfield_xxxx))
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.
WORKAROUND:
Added from closed duplicate, with thanks to the original commenters. AUTO-344 – Unable to enter spaces within "Create Variable" action textboxes. - not yet tested:
- In regards to the work around, you can also just start with {{}} and then type your smart value within it. That will work.
- A work-around I use for this behavior of the Smart Value expression is to use placeholder text, and use replace() later to substitute what is needed, such as spaces. This also helps when needing a created variable which needs to be initialized to null, but cannot be.