- 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-22-2022 03:17 AM
Hi Priya,
Assuming you are having 1 custom date/time field on incident to hold it and assuming this should be set everytime the User Changes and when it is not empty
Before Update BR on incident table
Condition: assigned to Changes AND assigned to is not empty
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.dateTimeField = new GlideDateTime();
})(current, previous);
Regards
Vaishnavi Lathkar

- 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-22-2022 03:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 06:26 AM
Hi @Aman Kumar S,
Is this possible in Flow Designer?
I have one subflow, where I need to get the Alert fields.
i.e. Alert Acknowledged at and Time to acknowledge the alert
Thanks..!!