Najmuddin Mohd
Giga Sage

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.