"I am new to JSM and could not find anything that is 100% similar to my issue.
I have created three custom fields. Fields 1 and 2 relate to date/time, and their format is (date/time[Time stamp]). The third custom field is the duration in minutes.
The idea is to calculate how long it took to resolve the solution.
For example, Duration = resolved - created,
but in my case, Duration = custom2 - custom1.
I can create an automation that writes the value (in minutes) to the duration field when the case is closed.
This "code" is working fine: {{created.diff(resolved).minutes}}.
However, I want to use custom fields 1 and 2 instead of the created and resolved fields.
I have tested:
{{custom_field1.diff(custom_field2).minutes}}
{{"custom_field1".diff("custom_field2").minutes}} etc....without success 