"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 :(
Hi Kari,
Try this: {{issue.First Field.diff(issue.Second Field).minutes}}
where First Field and Second Field are the EXACT names of your fields (including case).
Or this one using the field ID
{{issue.customfield_10156.diff(issue.customfield_10176).minutes}}
where the 10156 and 10176 are the actual IDs of your custom fields.
Hi John,
Thanks for the quick reply, first solution worked well:
{{issue.First Field.diff(issue.Second Field).minutes}}
Thank you :)
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.