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

  • 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?