- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 08:20 AM
Hello,
We have a record generator using a script (see below) rather than field selection (because we need to use multiple variables to populate the description field) which is creating an incident exactly how we want, but also creating a second record with just default values in.
I've tried commenting out various lines to test but it either then fails completely or just creates the blank record. The script has odd bits in from other posts with similar issues in an attempt to fix it as well, but nothing seems to have worked so far.
Any pointers gratefully received while I still have hair 🙂
thank you!
var incident_id = createincident();
var uri = ('this is the URL we point people back to and this bit is fine');
wizard.redirect = uri;
function createincident(){
var inc = new GlideRecord("incident");
var notes = "\n Office: " + wizard.var_office;
notes += "\n Desk Location: " + wizard.var_deskloc;
notes += "\n Is this a general desk/electrics problem?: " + wizard.var_general;
notes += "\n More Information on issue:" + wizard.var_moreinfo;
notes += "\n CMDB Item:" + wizard.var_selectasset.getDisplayValue();
notes += "\n ** This incident was raise via the reporting wizard on the XXXXXXX Portal **";
inc.description = notes;
var desk = wizard.var_deskloc;
var shrt_desc = " Desk Issue at "+desk+ "";
inc.short_description = shrt_desc;
inc.impact = 3;
inc.urgency = 3;
inc.category = "End User Productivity";
inc.subcategory = "Misc";
inc.cmdb_ci = wizard.var_selectasset;
inc.location = wizard.location;
inc.caller_id = wizard.var_yourname;
inc.assignment_group.setValue('4cf41d1b0fea42002630748362050e0c');
inc.opened_by = wizard.var_yourname;
inc.contact_type = "Self-service";
var inc1 = inc.insert();
//return inc1;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 01:53 AM
Hi,
The nice people at ServiceNow sorted this for us. For anyone else having a similar issue, we had to change the table in the record generator to "global" rather than incident. It works a treat now 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2017 08:18 AM
How is this script triggered? (for example like a button click,etc).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2017 03:03 AM
Hi, It is the final panel in a wizard - record generator.
thx 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2017 03:56 AM
Hi - I don't suppose you had any other thoughts on this did you? Thanks in advance 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 01:53 AM