Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 09:44 AM
Hi @Charan123 ,
Below is the code.
unction getMultipleIncidentDetails() {
var incidentDetailsArray = [];
var details1 = {
'Incident' : 'INC001000',
'Affected User' : 'Abraham Lincoln',
'Priority' : '1 - Critical',
'Assignment Group' : 'Application Developement',
};
var details2 = {
'Incident' : 'INC001002',
'Affected User' : 'Test 2',
'Priority' : '3 - Moderate',
'Assignment Group' : 'Service Desk',
};
incidentDetailsArray.push(details1);
incidentDetailsArray.push(details2);
return incidentDetailsArray;
}
// Example usage of the function
var ans = getMultipleIncidentDetails();
gs.info(JSON.stringify(ans));OUTPUT:
*** Script: [{"Incident":"INC001000","Affected User":"Abraham Lincoln","Priority":"1 - Critical","Assignment Group":"Application Developement"},{"Incident":"INC001002","Affected User":"Test 2","Priority":"3 - Moderate","Assignment Group":"Service Desk"}]Run it in the scripts - background to validate the output.
If this information helps, kindly mark this post as Helpful and Accept the soultion.
Regards,
Najmuddin.