Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
Add attachment to JIRA from Service manager via POST

Error msg

Can someone help please. Am trying to send attachment from service manager to JIRA via REST API using POST from Javascript. Using doHTTPRequest but keep getting Error 500. Not sure what is going wrong. script below, attc[0] is attachment object fetched from system.

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;
}

Thanks

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda