- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 03:12 AM
Hi Team,
once the request is submitted and task is assigned to user. The below mentioned functionality should be implemented:
-
Created (OOB field - which is available in the instance) – Which displays Date and time when the task is opened.
-
1st Custom field( Assigned Date – create new field) – When the ticket is assigned to, we have to get the current updated date time and store it in custom field, If reassignment count is 0. ( Validation: If reassignment count is greater than ( > 0) then the custom field should not be updated.
-
2nd Custom field(Date Difference – create new field) – This will compare the created by field time duration with (1st custom field - Assigned Date) and will display the time duration in 2nd custom field.
Can any one help me on this task.
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 03:28 AM
Hey,
1. Created field works OOB, no config required for that.
2 & 3. For Assigned date field, you can have a Update-Insert/Before BR in place, with condition:
Assigned to - changes and Assigned to - is not empty and Reassignment Count - is - 0
In script you can just write
var currDate = new GlideDateTime();
var created = new GlideDateTime(current.getValue("sys_created_on");
current.assigned_date = new GlideDateTime();
current.date_difference = new GlideDuration(GlideDateTime.subtract(created , currDate));
Note: make sure your 3rd field is a duration field type
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 01:28 AM
Hi @RK1111
Yes, it will work in a flow as well, you just need to use the script option available for the field mappings.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 02:50 AM
Hi @Aman Kumar S ,
Thanks for replying.
I need to update below 2 fields through subflow.
I used below script for "Acknowledged at", but it just gave me the current time.
Actually, the alert is not acknowledged yet. It should give the time when alert is acknowledged.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 02:51 AM