Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..
268 views

Error 500 when executing ScriptLibrary via REST API

Hi,

I have a scriptLibrary to delete bulk incidents attachments and created REST api to execute the script. The script being executed successfully, but getting error HTTP/1.1 500 Internal Server Error and I'm not sure how to return status 200 instead. Also, when i return something in function of script, it doesn't returned in result.

Btw, i followed the steps in following post earlier :-
https://community.microfocus.com/t5/Service-Manager-Service-Center/Create-Web-Services-REST-API-to-call-ScriptLibrary/m-p/1614186

Please help advice.
Thanks in advance

Tags (1)
0 Likes
1 Reply
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Hi,

Also, when i return something in function of script, it doesn't returned in result.

Yes, that's normal with the OOB functionality. But when you load the "ChatOps" Package their is a change inside the extaccess which allows you to define "Outbound javascript" which is helpful to return something back to the API.

https://marketplace.microfocus.com/itom/content/sm-chatops

P.S. I tested it and after the first load, the dbdict field "javascript" was added to the dbdict but not mapped to the SQL table. Please check after loading the unload, that the field exists in the Database. (if not, create it manually and map the SQL Field in the dbdict --> After this, you have to load the unload again to see the examples for outbound javascript)

I have a scriptLibrary to delete bulk incidents attachments and created REST api to execute the script. The script being executed successfully, but getting error HTTP/1.1 500 Internal Server Error and I'm not sure how to return status 200 instead. 

It's hard to say, where is error comes from without a sample script or something else.
When you call the delete script via the HPSM Client, does it work or do you get also some errors?

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.