- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 10:53 AM
am able to create incident as below ,but how to create incident task?
Please guide me
var gr = new GlideRecord('incident');
gr.initialize();
gr.description = 'Testing';
gr.insert();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 12:09 PM - edited 01-25-2023 12:10 PM
This should work
var inc = new GlideRecord('incident');
inc.initialize();
inc.short_description = 'Test Inc';
var inc_sys = inc.insert();
var incTask = new GlideRecord('incident_task');
incTask.initialize();
incTask.short_description = 'Test Inc Task';
incTask.parent = inc_sys;
incTask.incident = inc_sys;
incTask.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 11:25 AM
Update the table name in the first line.
Change incident to incident_task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 11:59 AM
Thanks for your quick reply,May be my question is wrong ,Am repharsing
my requirement is to create incident and incident task (incident task should link to same incident)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 12:09 PM - edited 01-25-2023 12:10 PM
This should work
var inc = new GlideRecord('incident');
inc.initialize();
inc.short_description = 'Test Inc';
var inc_sys = inc.insert();
var incTask = new GlideRecord('incident_task');
incTask.initialize();
incTask.short_description = 'Test Inc Task';
incTask.parent = inc_sys;
incTask.incident = inc_sys;
incTask.insert();