Clarity

  • 1.  SFTP on PPM Onpremise

    Posted Apr 04, 2017 01:00 PM

    Hi,

     

    I have a requirement to upload the files on SFTP.  We have SSH key and no password.

     

    We are on  'on premise' 14.3 version

     

    Can it be possible to via gel script, if yes please do share. On communities and documents I could find the way to  ftp on port 21 with user name and password but we are looking for SSH.

     

    https://communities.ca.com/message/15424306  refers to 'CLRT-69230 Add support for SFTP to GEL'.  Is it available in 14 or in above versions on 'on premise'



  • 2.  Re: SFTP on PPM Onpremise
    Best Answer

    Posted Apr 14, 2017 04:12 PM

    Unfortunately, there is no official CA maintained GEL tag to do this in any version of Clarity!  However, thankfully you are OP so you don't need official support in a GEL tag.  Wonderfully you have the freedom to do whatever you need to do as an on-premise customer to make Clarity viable with today's communication standards. 

     

    Often I have gone to the jsch library to accomplish SFTP connectivity because it has no dependency jars that aren't already shipped with Clarity.  You can do something like the following:

     

    - Download a copy of the jsch jar library and put it in the custom library folder at <NIKU_HOME>/customlib

    - Restart services 

    - In a GEL script create and invoke the client using Java

     

    For example, 

    <core:new var="jsch" className="com.jcraft.jsch.JSch"/>
    <core:invoke var="ftpSession" on="${jsch}" method="getSession">
    <core:arg type="java.lang.String" value="${sftpUser}"/>
    <core:arg type="java.lang.String" value="${sftpHost}"/>
    <core:arg type="int" value="22"/>
    </core:invoke>

     

    Then per your requirements you authenticate and pass or pull files as needed with jelly's invoke tag.  



  • 3.  Re: SFTP on PPM Onpremise

    Posted Apr 17, 2017 02:46 AM

    Thank you  so much for sharing this knowledge.