i am getting 500 as status code when to create incident in another instance through REST?

Manikantahere
Tera Contributor

May i know what are the possible reasons to get 500 as the http status?

 

int-1.pngint-2.png

2 ACCEPTED SOLUTIONS

Couple issues

 

request.body isn't the actual content but an object of different ways to access the body. request.body.data is likely what you're wanting. 

 

Also, on the GlideRecord, you need to pass in the table name as new GlideRecord('incident')

View solution in original post

Simon Christens
Kilo Sage

Can you log out whats request.body.data contains ? - check if anything is received

Can you provide the exact error you get - its hard to figure out when its just "500".
You should get a message with whats failing.

View solution in original post

10 REPLIES 10

Simon Christens
Kilo Sage

If you go into your outbound rest

Fill in some dummy data as a JSON payload

SimonChristens_0-1731671065456.png

Theres an error in my payload.

Save it and click on the related link "Test"

Then you will get a bit more details. - in my case its duo to invalid JSON payload

SimonChristens_1-1731671141844.png

Maybe this can help out on whats going on.

Once fixed - you should receive status 200

SimonChristens_2-1731671291290.png