Re: Sending Attachments from HP Service Manager to Service Now (176 Views)
Reply
Occasional Contributor
sfinch
Posts: 5
Registered: ‎11-20-2012
Message 1 of 2 (220 Views)

Sending Attachments from HP Service Manager to Service Now

I have been trying to send attachments from HP service manager to Service Now with no luck. The issue is getting the data from the attachments in HP SM, I have managed to find this code in Sm:

 

 

var f =newSCFile( 'incidents' );  

var rc =f.doSelect( 'incident.id = "SD10365"' );

var filePath ="c:\\";

var attachments =f.getAttachments();

print( attachments.length );

for ( var attachment in attachments )

   print("name: "+ attachments[ attachment ].name );

   print(attachments[ attachment ].href );

  print("type: "+ attachments[ attachment ].type );

   print("attachmentType: "+ attachments[ attachment ].attachmentType );

   var attachmentObj =f.getAttachment( attachments[ attachment ].href );

   var fileName = filePath + attachments[ attachment ].name

var fileObject = attachmentObj.value;

   var output =writeFile( fileName,"b", fileObject );  

 

this will create the attachments but the value is not what should be in the payload section to send to Service now.

 

Any ideas?

Please use plain text.
Esteemed Contributor
michael.gregory
Posts: 230
Registered: ‎02-10-2010
Message 2 of 2 (176 Views)

Re: Sending Attachments from HP Service Manager to Service Now

Hi,

 

Can you give us more information about the integration? I assume you're using webservices as this is the most straight forward approach for HPSM/SN integration. For the attachments are you trying to call the SN WSDL from HPSM or the other way around (call the HPSM WSDL from SN)?

 

Thanks,

 

Michael

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation