-
Type:
Bug
-
Resolution: Timed out
-
Priority:
Low
-
Component/s: Rule - Smart Values
-
Minor
-
Jira Software, Jira Service Management, Jira Work Management, Jira Product Discovery, Confluence, Bitbucket
Problem
When using the function .shortTime, it returns a different space character code, which causes issues when using conditions.
Steps to Reproduce
- Create an automation rule
- Add a smart value condition
- The First value should use a smart value with .shortTime at the end, i.e.:
{{now.withMinute(0).shortTime}} - Compare this with the current hour like 4:00 AM.
- Run the automation rule
Expected Results
The two values should be equal, satisfying the condition.
Actual Results
The condition fails as the type of space character differs between the two values.
Workaround
You can use the .format function to get the correct space char code:
{{now.convertToTimeZone("America/Montreal").withMinute(0).format("h:mm a")}}
You can also copy and paste in a " " (narrow, no-break space character) into the second value like 4:00 AM.
Notes
The .shortTime smart value returns a character code 8239 (narrow, no-break space character) rather than 32 (no-break space character). This causes a bug when using the condition and manually typing the space using your keyboard.
Verifying the smart value output generates the following result:
Input: 10:00 AM Output: 49, 48, 58, 48, 48, 8239, 65, 77
Manually writing the same value results in the following:
Input: 10:00 AM Output: 49, 48, 58, 48, 48, 32, 65, 77