- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2013 07:23 AM
Good morning All,
I have a request to create a daily check list for the infrastucture team to track proactive efforts. I built a straight forward record producers that mearly requires a click of the submit button if all is well. If errors, warning, or investigation check boxes are selected I would like to create an incident per variable captureing the associated text variables. Most of this process is straight forward in my mind with a simple set of if statements. I tried using current.insert; but it did not generate multiple incidents.
Very simple stages at this point.
if (producer.citrix_warning == "true")
{
current.short_description = "Citrix Warning";
current.assignment_group.setDisplayValue("Infrastructure");
current.assigned_to = producer.caller_id;
current.insert;
}
if (producer.vmware_warning == "true")
{
current.short_description = "vmware Warning";
current.assignment_group.setDisplayValue("Infrastructure");
current.assigned_to = producer.caller_id;
current.insert;
}
Thanks
Bruce
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2013 07:35 AM
Hi.
I've never done this personally but you should be able to do this by manually creating a new GlideRecord insert. Reusing "current" won't create unique records but if you go through a GlideRecord query and insert that way, you should get the second unique record created.
Something like...
var gr = new GlideRecord('incident');
gr.initialize();
// you'll need to go through all of the variables on your record
gr.short_description = g_form.getValue('short_descrpition'); // like this
gr.insert();
See more at http://wiki.servicenow.com/index.php?title=GlideRecord#Insert_Methods
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2013 06:10 PM
current.insert() worked but my inc number did not enumerate. The () was the part I was missing from my initial attempt. Thank you for your reply.