Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..
560 views

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

Tags (2)
0 Likes
3 Replies
Highlighted
Valued Contributor.
Valued Contributor.

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

0 Likes
Highlighted
Valued Contributor.. Valued Contributor..
Valued Contributor..

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

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.