Set Status of Incident to In Progress from OnHold when Date/Time duration is crossed

SNOW46
Tera Contributor

Hello All,

I have a requirement that when Incident Status is changed to On Hold, then On Hold Reason will open where Assigned to User needs to select as Enhancement option from the drop down menu and the SLA will get Paused.

Once the user selects Enhancement option, then a new Date/Time field will open below the On hold Reason field.

When the Assigned to user selects any particular Date and Time so till that duration or date/time the Incident will remain as On Hold and once the duration is completed or the Date is crossed, then the Status should automatically changed to In Progress and at the same time a notification should trigger to the Assigned to User stating the Incident Status has been changed to In Progress now.

 

Can someone please help me in achieving this requirement as its very urgent for me and I need to showcase a demo on this to the customer this week.

 

Thankss

6 REPLIES 6

suvro
Mega Sage
Mega Sage

Whenever that date time field is set.

Trigger a business rule and use

 gs.eventQueueScheduled()

Using the above method you can trigger an event based on date time field. Whenver that date time is reached it will trigger the event.

You can write a script action on that event to change the state and you can also configure a notification based on that event.

SNOW46
Tera Contributor

Hi,

Actually I am not that much good in scripting, it will be good if you can describe me in details as to what the script should contain and what all will be conditions to be set.

 

Thanks

1. First of all create an event from Event Registry module

2. Create a Notification 

Select when event is fired and give the name of the event you created in step 1. Do rest of the configurations as required

3. Configure a Business Rule on Incident Table 

with condition: State is On Hold AND <New Date time> changes AND <New Date Time> isNOTEMPTY

4. Script: 

gs.eventQueueScheduled('on.hold.reminder', current, current.sys_id, 'parm2', current.<date_time_field>);

 

5 Create a script action -> select the even created by you with below script

var gr = new GlideRecord('incident');

   gr.addQuery('sys_id', event.parm1);

gr.addQuery('state', 11);

gr.query()

if (gr.next()){

gr.state = 2;

gr.update();

}

SNOW46
Tera Contributor

Hello,

I have a small doubt here like in Step 3 

3. Configure a Business Rule on Incident Table 

with condition: State is On Hold AND <New Date time> changes AND <New Date Time> isNOTEMPTY

 

<New Date time> indicates what I can't able to get it.

In Step 4

4. Script: 

gs.eventQueueScheduled('on.hold.reminder', current, current.sys_id, 'parm2', current.<date_time_field>);

Here on.hold.reminder indicates what and date_time_field is the new field which I will configure right?

 

Please suggest me here.

 

Thanks