Integration: Values are setting as org.mozilla.javascript.NativeArray in Incident

NehaSNOW
Tera Guru

Dear Members,

 

I have designed the Scripted REST API to create an Incident in the ServiceNow. 

Issue: - An Incident is created from the REST API Explorer but with the values in the Short Description and Description fields as "org.mozilla.javascript.NativeArray". In the logs the variables are getting the correct values from the Query Parameters but when these variables are passed to the GlideRecord object the 'org.mozilla.javascript.NativeArray' is set.

 

Please suggest.

Release: - Xanadu

 

Code: -

NehaSNOW_0-1738522300012.png

 

Logs: -

NehaSNOW_1-1738522337274.png

NehaSNOW_3-1738522397243.png

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@NehaSNOW 

use toString() while setting the values from line 13 to line 15

gr.short_description = shortDesc.toString()

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@NehaSNOW 

use toString() while setting the values from line 13 to line 15

gr.short_description = shortDesc.toString()

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader