- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 03:03 AM
How Timer/Stopwatch can be added to the form so that when user open the ticket can able to see the remaining time for the ticket so that user can solve the ticket.
When User clicks on Publish button then Timer/Stopwatch needs to start.
Note: SLA's are not there can't configure
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 01:52 AM
Hi,
Create a onDisplay BR on your table. and in the script add this code.
i assume Time left is a duration field.
(function executeRule(current, previous /*null when async*/ ) {
var gdt = new GlideDateTime(current.im_notification); //put right field name
var gdt1 = new GlideDateTime(current.next_update_due); //put right field name
var dur = new GlideDuration();
dur = GlideDateTime.subtract(gdt, gdt1); //the difference between gdt1 and gdt2
current.u_time_left.setValue(dur); //put right field name.
})(current, previous);
Mark the comment as a correct answer and also helpful if this helps to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 09:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 01:52 AM
Hi,
Create a onDisplay BR on your table. and in the script add this code.
i assume Time left is a duration field.
(function executeRule(current, previous /*null when async*/ ) {
var gdt = new GlideDateTime(current.im_notification); //put right field name
var gdt1 = new GlideDateTime(current.next_update_due); //put right field name
var dur = new GlideDuration();
dur = GlideDateTime.subtract(gdt, gdt1); //the difference between gdt1 and gdt2
current.u_time_left.setValue(dur); //put right field name.
})(current, previous);
Mark the comment as a correct answer and also helpful if this helps to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 02:06 AM
thanks will check and will let you know if it's working or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 02:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 02:32 AM
In the Br, you can add a check and based on severity, you cna mention the required time.
Let me know if you need any help here. Also if severity is 2.. you have to exclude hours always? how many such conditions are there? y