Automation Smart calues not rendering

galin.ivanov January 20, 2020

Hello, 

I have an automation rule, which contains the following line : 

Created: {{issue.created.format("dd/MM/yyyy")}}

 

And I get an error that this row cannot be rendered correctly. I made some tests and if  I remove the .format part it's working. Can you give me some advice on how can I fix this issue? 

1 answer

0 votes
Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2020

Hello @galin.ivanov 

I have been trying out similar smart values using dates which has not been very successful. The problem I have alteast is that your jira instance i set to another date format. You can check this by going to Jira administration -> System -> Advanced settings

image.png

My smart values behaves just as you describe when i try to format it by myself. I can only use the default format. I don't know why it behaves like this.

My solution was to create a regular text custom field and put the date there. It doesn't show up on the side next to other date fields, but atleast I could format the date in a way that is more common in my country. Not the best solution but it does the job for me.

Best regards,

Alexander

galin.ivanov January 20, 2020

Hello @Alexander Ling ,

 

And thank you for you update, but even if i try using the default format is still the same behavior: 

Error rendering smart-values when executing this rule:Failed to get value for issue.created.format("dd/MMM/yy h:mm a"): Created: {{issue.created.format("dd/MMM/yy h:mm a")}}

 

Failed to get value for issue.created.format("dd/MMM/yy"): Created: {{issue.created.format("dd/MMM/yy")}}

 

I have checked and out Jira instance settings are the same as yours.

 

Best Regards,

Galin

Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2020

Can you try to change the rule into writing the date in the description or in a comment? image.png

galin.ivanov January 21, 2020

The idea for this automation is to send the date in an mail. It needs to check the due date and if it's less 1 day till due date, to send mail.

Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2020

Yes, but I just wanted to see if you could print the value into a simple text field so the absolute basic is working.

Can you screenshot the entire rule you are trying to run?

galin.ivanov January 21, 2020

I have used to log the result, and here is the result  Created: 2020-01-15T13:49:38.6+0200

image.pngimage.png

Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2020

Hm. I can write {{issue.created.format("dd/MMM/yy")}} and it works fine. I can also write  {{issue.created.format("dd/MMM/yy h:mm a")}} so I can't really replicate the issue. The only time I can get a similar error is when I try to set a date-field to another format that is not defined in the jira instance.  So I don't think I am able to help with your kind of issue.

One question though, since you want to automate this, why don't you run a scheduled trigger? This will allow you to use JQL without any other triggers needed. Maybe you already thought of this or maybe you have a better solution, just making sure that you know that the scheduled trigger exists. :-)

galin.ivanov January 21, 2020

It's mainly scheduled trigger, just I moved the braking part of it in different automation to see what's the issue, and how to solve it.

 

Thank you!

Suggest an answer

Log in or Sign up to answer