title: Jenkins Pipeline - Upload to Artifactory: Failed to deploy file / Parent must be a folder
body: <p>I have a Jenkins job which generate a zip file I want to updload to Artifactory. I have an issue setting the version of the artifact to be uploaded.</p>
  
  <p>By convention, I use the timestamp has version. I want to upload file to <code>my/group/timestamp/file.zip</code>. The url of the file would be <code>http://ArtifactoryAdress/foo/my/group/timestamp/file.zip</code></p>
  
  <p>Here is my pipeline code</p>
  
  <pre><code>def serverArtifactory = Artifactory.server 'NameArtificatory'
  def uploadSpec = """{
        "files": [
          {
            "pattern": "file.zip",
            "target": "my/group/${timestamp}/"
          }
       ]
      }"""
  serverArtifactory.upload(uploadSpec)
  </code></pre>
  
  <p>I get the following error from Jenkins Job</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: java.io.IOException: Failed to deploy
    file. Status code: 400 Response message: Artifactory returned the
    following errors: 
        Parent my/group/timestampValue must be a folder Status code: 400</p>
  </blockquote>
  
  <p>I looked around buildInfo but was not able to find how to set a version.</p>
  
  <p>By the way, I am also agree with a solution without the timestamp but only group name.</p>