- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2014 01:52 AM
Hi All,
I am trying to create an incident if CI is not found on a particulate table. Below is the business rule code that looks for CI's.
When: before
Insert: Checked
var circuit = new GlideRecord('cmdb_ci_ip_network');
circuit.addQuery('u_circuit_reference',current.u_circuit_string);
circuit.query();
if (circuit.next()){
current.u_ci = circuit.sys_id;
current.u_status = "Found CI circuit match";
}
else {
current.u_status = "No CI circuit match";
current.u_notify = false;
}
I would appreciate any help or starting point on what I need to add to create an incident if the CI circuit match is not found.
Thank you.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2014 02:03 AM
Hi Shoaib,
This is sample script and you can modify it according to your conditons.
var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = 'learn about GlideRecord';
gr.insert(); //insert the new record
Please refer below wiki link section12 for more info
http://wiki.servicenow.com/index.php?title=GlideRecord
Thanks
Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2014 02:03 AM
Hi Shoaib,
This is sample script and you can modify it according to your conditons.
var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = 'learn about GlideRecord';
gr.insert(); //insert the new record
Please refer below wiki link section12 for more info
http://wiki.servicenow.com/index.php?title=GlideRecord
Thanks
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2014 05:26 AM
Thank you for your Help Pradeep.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2014 05:29 AM
I am glad I can be helpful
Would you mind marking my answer as correct if is resolved.
Thanks
Pradeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 11:53 PM
i m okey with code
but i want
Create a Problem from Incident ticket.Once the problem ticket is closed corresponding incident ticket should also get resolved.