Send the parameters using REST

Hello people,
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.

Regards,

Vitor Neto

tjChamadoSoftPlan.zip
  • HI,

    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.

    Thanks

    Sivu

  • Hello Vuyi, thanks for your reply.

    The script was wrong, i attached the right script again.

    I did what you said, and it printed my body correctly, but it still was not sent to the other system.

    Thanks a lot.

    Best Regards,

    Vitor Neto

    tjChamadoSoftPlan.zip
  • Hi,

    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.

    Thanks

    Sivu