- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2015 03:41 AM
Hi guys, i have task to copy an attachment from an incident, from one instance to a change request in another instance using soap web services. Can anyone help me on this.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2015 12:55 AM
hi guys i found the solution
used these two to finish the code GlideStringUtils, GlideSysAttachment
revised code:
var StringUtil = new GlideStringUtil();
var attachments = new GlideSysAttachment();
var fileName, contentType;
var gR = new GlideRecord('sys_attachment');
gR.addEncodedQuery('table_name=incident^table_sys_id='+current.sys_id);
gR.query();
while(gR.next()){
try {
var binData = attachments.getBytes(gR);
var encData = StringUtil.base64Encode(binData);
gs.log('XML Respons for payload='+encData);
var s = new sn_ws.SOAPMessageV2('Copy attachments', 'insert');
s.setStringParameter('source', 'change_request:'+current.u_change_sysid);
s.setStringParameter('payload', encData);
s.setStringParameter('topic', 'AttachmentCreator');
s.setStringParameter('agent', 'AttachmentCreator');
s.setStringParameter('name', gR.file_name+':'+gR.content_type);
var response = s.execute();
var responseBody = response.getBody();
var status = response.getStatusCode();
}
catch(ex) {
var message = ex.getMessage();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2021 10:12 PM
Hi Dinesh,
I got the same requirement as you performed few years back, could you please help me with SOAP MESSAGE.
like how do u create SOAP MESSAGE and what are the steps you followed.
Thanks & Regards,
Aswartha Reddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2021 08:57 AM
Hello Dinesh,
Same thing I want to apply change request. Is it possible the same code