How to print active incidents through glide record?
This content was last updated in 2024. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 08:03 PM
How to print active incidents through glide record?
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 08:29 AM
@Srinivas snow28 Here is the sample script for you.
var gr = new GlideRecord('incident'); // Create a new GlideRecord object for the 'incident' table
gr.addActiveQuery(); // Add a query to return only active incidents
gr.query(); // Execute the query
while (gr.next()) { // Loop through each record returned by the query
gs.print('Incident Number: ' + gr.getValue('number')); // Print the Incident Number
gs.print('Short Description: ' + gr.getValue('short_description')); // Print the Short Description
gs.print('Assigned To: ' + gr.getDisplayValue('assigned_to')); // Print the Assigned To (display value)
gs.print('---'); // Print a separator between incidents
}
Please mark the response helpful and accepted solution if it addresses your question.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 08:39 AM
It should be an easy task.
What did you start with and where are you stuck?
Unless you start you won't be able to learn.