- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 08:47 PM
Is it possible to create an Incident, when a specific Event occurs? If Event 'integration.send_warning' triggers, create an Incident. And add the following values to the Incident:
Description = Parm 1 of the Event
Short description = Download Activity Alert
Assigned Group = Download Activity Alert
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 12:02 PM
Hi @MStritt,
There is no need to create a Script Include for this, you can add the script in the Script Action.
Try the following script:
var incGr = new GlideRecord('incident');
incGr.initialize();
incGr.setValue('description', event.parm1.toString());
incGr.setValue('short_description', 'Download Activity Alert');
incGr.setDisplayValue('assignment_group', 'Download Activity Alert');
incGr.insert();
Note that you are using the display value of the assignment group. This may change in the future, so you may want to consider using the sys_id instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 10:49 AM
Thanks James.
Can you provide sample code for the script include? I'm using the below in the Business Rule, but it's not working when the event is fired.
var gr = new GlideRecord('incident');
gr.initialize();
gr.description = current.parm1;
gr.short_description = 'Download Activity Alert';
gr.assignment_group = 'Download Activity Alert';
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 12:02 PM
Hi @MStritt,
There is no need to create a Script Include for this, you can add the script in the Script Action.
Try the following script:
var incGr = new GlideRecord('incident');
incGr.initialize();
incGr.setValue('description', event.parm1.toString());
incGr.setValue('short_description', 'Download Activity Alert');
incGr.setDisplayValue('assignment_group', 'Download Activity Alert');
incGr.insert();
Note that you are using the display value of the assignment group. This may change in the future, so you may want to consider using the sys_id instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 12:19 PM
Fantastic! That worked. If I enter the sysid, do I have to put it in quotes or anything?
incGr.setDisplayValue('assignment_group', '12345678');
OR
incGr.setDisplayValue('assignment_group', 12345678);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 12:24 PM
No worries, if you are using the sys_id, it needs to be in quotes but use setValue, not setDisplayValue.
incGr.setValue('assignment_group', '12345678');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 11:06 AM
Hi @MStritt ,
You need to create Business Rule on sysevent table and add the filter condition like state is processed
Please check the image below :
Add below code
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord('incident');
gr.initialize();
gr.description = current.parm1 + 'Download Activity Alert';
gr.assignment_group = <Sys_id of group>;
gr.insert();
})(current, previous);
Please reach me out if you need anything.
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak