
Puede alguien ayudar, por favor. Estoy tratando de enviar un archivo adjunto desde el administrador de servicios a JIRA a través de la API REST usando POST desde Javascript. Usando doHTTPRequest pero sigue recibiendo el error 500. No estoy seguro de qué está fallando. script a continuación, attc[0] es un objeto adjunto obtenido del sistema.
doAttachOut("POST",url ,attc[0].value,20,attc,null,attchmentName); function doAttachOut(httpAction,url,binaryData,timeout,attachmentObj,param,attchmentName) { var JSON = system.library.JSON.json(); var headers= new Array(); headers.push(new Header("Authorization", "Basic token")); headers.push(new Header("X-Atlassian-Token", "no-check")); headers.push(new Header("Content-Type", "multipart/form-data")); headers.push(new Header("Accept", "application/json")); headers.push(new Header("Content-Disposition", "attachment;file=@"+attchmentName)); try { var respHeaders = new Object(); var resp = doHTTPRequest(httpAction, url, headers, binaryData, 20, 20, null, respHeaders); //var resp = doHTTPRequest(httpAction, url, headers, null, 20, 20); print(resp); var objResponse = JSON.parse(resp); print("Messages: \n"+objResponse.Messages.join("\n")); print("Return Code: "+objResponse.ReturnCode); print("Attachment Name: "+objResponse.attachment.name) } catch( cError ) { print("ERROR: \n"+cError); } return resp; }Gracias