HPE Service Manager / Service Center Support and News Forum
Showing results for 
Search instead for 
Do you mean 

Sending Attachments from HP Service Manager to Service Now

Occasional Contributor

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?

1 REPLIES
Highlighted
Esteemed Contributor Esteemed Contributor

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