IT Process Automation

  • 1.  how to fetch attachment from SDM to PAM IRF

    Posted Jun 22, 2014 07:40 AM

    hi there, i need to attach direct link of SDM attachment in my Approval Task IRF.

    any one already did the same, please share ur experiance.



  • 2.  Re: how to fetch attachment from SDM to PAM IRF

    Posted Aug 12, 2014 09:41 AM

    Hello Community,

    Any help here for akhan.1?
    Thanks,

    Mary



  • 3.  Re: how to fetch attachment from SDM to PAM IRF

    Posted Aug 12, 2014 11:49 AM

    Hi Akhan,

     

    I don't know if SDM supports a direct link to attachments.  According to the reference guide, the attmnt object has fields that can point you to the location on the SDM server filesystem, but I don't see anything about how it gets served up as a URL.  You can try the SDM forums to see if they can point you in the right direction.

     

    Thanks,

    Tom



  • 4.  Re: how to fetch attachment from SDM to PAM IRF

    Posted Nov 11, 2014 11:33 AM

    Thanks Tom for your response. Akib, click here for the CA Service Management community!

    Mary



  • 5.  Re: how to fetch attachment from SDM to PAM IRF

    Posted Jun 22, 2016 05:07 PM

    I am also dealing with this. I'm able to generate a list of attachments and get their information regarding them but I do not have the ability to get a URL to those attachments. I very much need the ability to place links to those attachments into my IRF's & associated emails for Supervisory Review. I'll place a question in the CA Service Management Community and reference this question. Hopefully they don't send my back over here



  • 6.  Re: how to fetch attachment from SDM to PAM IRF

    Posted Jun 28, 2017 12:49 PM

    You can generate a link to an attachment in sdm through pam using the following:

    first run a soap invoke against SDM. The invoke payload will look like this

    <impl:getBopsid xmlns:impl="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
      <sid>sid__</sid>
      <contact>contact__</contact>
    </impl:getBopsid>

    This gets you the BOPSID for the link.

    Next you'll want to select the attachments from SDM. This is done via:

    This gets you the original file names...

     

    Next you'll run a javascript to treat the two previous calls. It looks like this:

     

    // JavaScript source code
    Process.BaseXML = convertXml(applyXPath(Process['SEL_Attmnts'].SoapResponseBody, "//doSelectReturn")).text_;
    var xpGetAttribute = function (attrId, xml) {
      var xpath = "//AttrName[text()='" + attrId + "']/following-sibling::AttrValue/text()";
      return applyXPath(xml, xpath);
    }
    Process.attachments = applyXPath(Process.BaseXML, "//UDSObject", true, true);
    //loop the attachments

    Process.links = '<ul>';

    var bopsid = Process.Invoke_Service_Desk_Web_Servic_1.getBopsidReturn;
    var sid = Process.Invoke_Service_Desk_Web_Servic_1.ServiceDeskSessionID;


    for (i = 0; i < Process.attachments.length; i++) {
      var attXML = Process.attachments[i];
      var name = xpGetAttribute('attmnt.orig_file_name', attXML);
      var attid = xpGetAttribute('attmnt', attXML);
      var fid = Math.random();
     
      var NX_WEB_CGI_URL = Process.ConfDS.att_NX_WEB_CGI_URL;
      var NX_SERVLET_SERVER_URL = Process.ConfDS.att_NX_SERVLET_SERVER_URL;
      var att_repository_server = Process.ConfDS.att_repository_server;
      var szLink = NX_WEB_CGI_URL+"?OP=LINK_WITH_BOPSID+URL="+NX_SERVLET_SERVER_URL+"/CAisd/UploadServlet?AttmntId="+attid+"%26Bpsid=%25bopsid%26retURL="+NX_WEB_CGI_URL+"?OP=DISPLAY_FORM%2BHTMPL=attmnt_download_done.htmpl%26ServerName="+att_repository_server;
      //Process.links += '<li><a href="'+szLink+'">' + name + '</a></li>';
     
      Process.links += '<li><a href="'+szLink+'">'+ name + '</a></li>';
     
    }
    Process.links += '</ul>'

     

    Done!