Send the parameters using REST
I'm doing an integration of HSPM with another system using REST.
I can open the ticket in the other system but the parameters are not being sent.
I tried to pass the parameters directly through the url, but the function of the HTTPRequest returns error.
I'm doing now via json, but even the parameters are not being passed to the other system too.
The following script is attached. If someone has an example of how to do it.
Thank you so much.
Looking at your code I noticed the follwing:
//at line 12 you declare a variable postBody on this function geraTicketJson
// at line 79 you declare retorno variable and assign the results of the dorestpostrequest
It looks like you are not assigning anything to the postBody variable, so you are posting an empty postBody.
I would recomend you:
Print your postBody variable before calling the doRESTPostRequest and see what you get.
I hope this helps.
Can you please search your script library and verify that you have a script called "doHTTPRequest" called by your function doRESTPostRequest on line 171, I think you are calling a script that does not exist in your script library on that function.