Hi
I have an automation that displays difference between two dates put in custom fields in Hours. I'm interested if it would be possible to have hours and minutes at the same time.
Smart value used is : {{[date1].diff([date2]).[unit]}}
Thanks
Gosia
Hi @Małgorzata Adamska-Piotrowska,
Try to use just {{[date1].diff([date2])}}
It will return difference in hours and minutes.
Hi- it doesn't work in my case.
I use advanced settings to edit my field but without any unit the automation does not work.
{
"fields": {
"customfield_22188":
"{{issue.customfield_21712.diff(issue.customfield_21713)}}"
}
}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Małgorzata Adamska-Piotrowska, got it. {{[date1].diff([date2])}} returns time difference as string like "1 hour 30 minutes". You can't add a string value to a number field, that's the error.
Please use a text field instead of customfield_22188.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a bunch for this! It works:)
Best
Malgorzata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Małgorzata Adamska-Piotrowska
If you would use:
{{[date1].diff([date2]).prettyPrint}}
So don't use an specified unit option, but the prettyPrint option
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi. Thank for the suggestion. It doesn't work though.
My final action is set in Additional Fields section and after modification it looks like this.
{
"fields": {
"customfield_22188":
"{{issue.customfield_21712.diff(issue.customfield_21713).prettyPrint}}"
}
}
Should it be done in another way?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Małgorzata Adamska-Piotrowska
I see in your reply to @Kseniia Trushnikova that customfield_22188 is a number field.
Then prettyPrin can't work as you store the result in a number field, that can only contain a number.
I think you should use a text field instead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. It worked without any unit but with prettyPrint option it doesn't.
Maybe there is also a trick somewhere else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Małgorzata Adamska-Piotrowska
I don't see how, unless not using a number field as than can't contain other information than a number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. I think I'll give it one more try.
Thanks for your help!
BR
Malgorzata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I have a similar problem. I want to update one custom filed (Cust_Response Duration) of type Short text, with the difference of current time and value in a custom date field. I am using the below smart value in my automation , but every time the rule runs , the Audit log shows "No Actions Performed" , Can anyone please help as to why the custom field "Cust_Response Durantion" is not getting updated .
Smart value which I have put in the automation rule for editing the custom field Cust_Response_Duration is :
{{now.diff(issue.Cust_Response Time)}}
Thanks
Sharmila
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.