HPSM Javascript to update tickets using SOAP

Hi Experts,
I need your help please.

Can anyone send me a javascript to be triggered to update tickets from HPSM to another system using SOAP API (the other system can be also HPSM).

Can you please help me with this? 


  • There are several examples in SM already, and there should also be a guide out there somewhere. Essentially, you import the WSDL (convert WSDL to JavaScript) and then create the message(s) you need to send by calling the functions in that Script from other JS places.

  • Hey Josh_MM,

    Thank you for your reply.
    I understand that, but can you please help me if you have a sample javascript that will be triggered whenever we want to update a ticket in another system? 

    Does anyone have any sample script? 



  • An example of the outgoing call is (modified to be generic).

    In a formatctrl:

    $L.junk=externalSystem.sendMessage(custom_key in $L.file, "", $L.file, cartID in $L.file, $L.file0)


    The code for sendMessage (simplfied, and without proper error handling) in ScriptLib "externalSystem"):

    function sendMessage(Key_ID, strTopic_ID, fRecord, fCartItem, fRecordOld )
     var  strLocation = "">server:port/.../blah";
     var strUser = "name";
     var strPwd = "pw";
     var aService = new lib.TaskService.TaskService();
     aService.location = new String( strLocation );
     if ( strUser != null && strUser != "" )
      aService.user     = ( strUser );
     aService.password = ( strPwd );
     // Invoke the service and create response
      var th = aMessage;
      var aResponse = aService.invoke( aMessage );
      return true;