Checking incident opened date vs closed date

gu2
Kilo Explorer

hi All.

I am quite new on service now

I am trying to write a script that checks if an incident closed is after the opened date.

I manage to get the closed date with g_form.getValue('closed_at'). but g_form.getValue('opened_at') return an empty value.

Help...

6 REPLIES 6

Gilles,



Make sure you have the opened_at field on the form. If it isn't on the form then g_form cannot see it. Which could explain why it isnt' working as your expect. You may also have to them the values returned into a javascript date time like this:

var timestamp = new Date(g_form.getValue('closed_at'))


Hi Gilles,



are you having that challenge now? I do not see how this is possible since the opened_at date and time are set by the system when the record is created. The close_at time is set by the system again once the INC state is changed to closed. Does your enterpriser resolve Incidents and then the OOB BR closed them for you within 3-7 days?