Script to determine age of a ticket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2015 06:10 PM
Hi everyone. I am happy you. All are here and can hopefully assist me
i tried this through inactivity monitor but it doesn't work correctly. So I would like to use another method like scripyin and have the scripting trigger an email
The parameters are. Check ll incidents if the incident is 30 days or more and still open, trigger an email to go out to the assignee of ticket. This should be done for all open, ain progress, pending or assigen. Got all tickets that are found an email is sent to the assignee and manager
i I don't want to use inactivity monitor. I would like to use a script which fire off an email
does anyone already have something like this or able ti share how this Cavan be accomplished
THANK YOU,,,
- Labels:
-
Integrations
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2015 03:27 PM
Yes Terry,
The event is not getting fired in the business rule, I just made another change to my original post. I'm almost positive that it is going to work this time. Could you please try again with this code in the business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2015 03:07 PM
Terry,
Email notification is looking good.
I just realized the Event screenshot that you shared was from System Policy -> Events -> Registry. Can you please do a search for "incident.unresolved" on System Logs -> Events?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2015 05:41 PM
Thanks, did you make 2 changes to the script code? I don't see the details of the second one. Can you cut and paste what script 1 and script 2 should be and I will update them both?
THANK YOU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2015 05:43 PM
Hi, I tried checking and unchecking conditional and nothing happens. No updates in the log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2015 08:22 PM
Terry,
I just tested this, it is working in my instance with and without conditional.
Could you please share you scheduled job? After you run the job you should see the events created in System logs -> events.
EDIT: Could you run this script as a Background script? (Scripts - Background in navigation bar)
- var i = 0;
- var gr = new GlideRecord('incident');
- gr.addQuery('incident_state', '<', 6);
- gr.addQuery('sys_created_on', '<', gs.daysAgo(30));
- gr.query();
- while(gr.next()){
- i++;r);
- }
- gs.print(i);