I have tried looking at the documentation, however, I could not find all the details I need, thus hoping someone would be able to provide some guidance.
We have - ServiceNow and JIRA on prem (server) and we can create issues in the instance.
When trying to upload an attachment form a ServiceNow incident, it all fails.
This is what we have so far (javascript):
try {
var r = new sn_ws.RESTMessageV2('Jira Outbound Integration OnPrem', 'POST ATTACHMENT');
r.setStringParameterNoEscape('instanceName', 'JIRAPROD');
//file as base64 or we can pass the url https://instance.service-now.com/sys_attachment.do?sys_id=53ae1bdb4510c0852022604bcb2c
r.setStringParameterNoEscape('contentJSON', '{"file":"c21hbGwgdGV4dCBmaWxl"}');
r.setStringParameterNoEscape('issueID', 'JACK-6738');
//url for the REST call in the end looks like https://JIRAPROD/jira/rest/api/latest/issue/JACK-6738/attachments
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}
catch(ex) {
var message = ex.message;
}
The file is stores in the instance and can be anything. We can get the file name as well if needed for the call.