How best to create recurring tickets for multiple people?

John Lockwood
Kilo Contributor

I want to setup an automatic recurring i.e. scheduled Incident which is assigned to System Owners and prompts them to do a maintenance task. Once they have completed the task they will be able to mark the incident as solved.

Note: I would not classify this as a recurring change request as the maintenance in question is to merely review who has access to their system.

I can see that I could create a template for an incident and set a schedule for it and this would therefore work for a single System Owner. However if I have say 20+ System Owners - other than duplicating this 20+ times is there a way of say creating one and choosing a group and it then creating individual recurring incidents for each member of the group?

On a related topic, would the System Owners need to be defined as 'fulfiller' level users so they can 'resolve' these tickets.

1 ACCEPTED SOLUTION

Ok below is the updated script.  You do not need to so variables for you table.  Once you query you have access to all the fields by doing source.u_short_description for example.  So you will see in my script below source.filed name.  When you see field name just replace it with the filed name in your source table.  Hope that makes sense.

var source = new GlideRecord('systemownerstable');
source.query(); // Issue the query to the database to get all records 
while (source.next()) {
//read fields of record
var target = new GlideRecord('incident');
target.initialize();
//set values in new incident
target.short_description = source.field name;
target.category = source.fieldname;
target.caller_id = source.fieldname;
target.assigned_to = sourcerec.fieldname;
target.description = source.fieldname;
// write new incident
target.insert();
}

View solution in original post

13 REPLIES 13

Brian Lancaster
Tera Sage

I would create a table with the following information in it.

System Owner

Application they need to review

anything else you may need to create the incident.

 

Then you could use System Definitions > Scheduled Jobs to create the incident off of the custom table. 

 

Yes all users who need the ability to change the state of an incident to resolved would need and ITIL license (fulfiller).  Or you could have them as a caller and assign the ticket to someone who has a license so that the System Owener can email in an update stating that the review has been completed and the person with the ITIL license can resolve the incident.

If I create a table as you describe would it then result in multiple individual tickets - one presumably per record in that table?

So to add/remove additional systems and owners I would merely add/remove entries to that table?

Is it possible to add a user of ServiceNow to the table in question? Rather than merely typing a name in? The idea being you pick an existing user from a selector list and it would then also be able to attach their email address as well so it know where to send the notification email to.

Not done anything with custom tables as of yet.

Yes you it would be 1 ticket per record.  As for adding removing systems from the table yes you could just add new entries and delete ones no longer needed.  If for any reason you would need to keep all the data event if you were no longer creating tickets you would create a Active filed (true /false) with a default value of true.  Once you no longer need to create tickets for that one you could just un-check the box.  

Yes your System Owner filed would be a reference filed to the sys_user table.  This way it will work like caller and the incident form and make you scripting to create the incident much easier.

Ok, got part way there but clearly I am missing some big things.

I have created a table - to list the owners and systems with one record per system. I have created a matching template and for that template a schedule. I have also added the 'application' to a couple of test users - the same ones listed as the test system owners.

It creates two new records visible to the test user under the application name but both records are empty and both are visible to both test users. Hence something missing.

I need the records to fill in the short description at least of the system and to assign it to the system owner.

Should I be doing this as an extension to an existing table? (It is not possible to extend the Incident table but that is an extension of the Task table.)