Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2025 06:48 AM
Create incident and along with short-description & description using script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2025 06:58 AM
Hi,
This is a simple example of the script.
var incGR = new GlideRecord('incident');
incGR.newRecord();
incGR.setValue('short_description', 'Some text for short description');
incGR.setValue('description', 'Some text for a longer description here...');
incGR.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2025 07:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2025 07:24 AM
Hi @P1234,
You can create Incidents and set description and short description using server side script. Following is the code snippet:
var incidentGR = new GlideRecord('incident');
incidentGR.initialize();
incidentGR.setValue('short_description', 'ADD_YOUR_SHORT_DESCRIPTION');
incidentGR.setValue('description', 'ADD_YOUR_DESCRIPTION');
incidentGR.insert();
gs.info(incidentGR.sys_id);
Regards,
Ehab Pilloor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2025 07:54 AM
Hi @P1234
Try to keep it as low-code as possible.
You also didn’t mention how and from where you want to create the index.
Just writing one line won't help, mate. It’s actually quite simple—you can try it on your end as well.