title: How to get corresponding build artifacts of a job in jenkins ?
body: <p>I create Jenkins jobs using <strong>hudson.cli.CLI jar</strong>. I have selected <strong>"Archive the artifacts"</strong> option in the <strong>"Post-build steps"</strong> section. It archives the artifacts on each succesfull build. I am using <strong>jenkins remote access api</strong> <code>http://localhost:8080/job/job_name/api/json</code> to get details about <strong>jobs</strong>. and <code>http://localhost:8080/job/job_name/job_number/api/json</code> to get details about <strong>builds</strong>.</p>
  
  <p>When I delete a build corresponding archived artifacts are not deleted. I'd like to make sure that they are deleted.</p>
  
  <p>When I use jenkins remote access api <code>http://localhost:8080/job/[job_name]/[job_number]/api/json</code> for a build, it returns json data which contains <strong>all</strong> previously archived artifacts (other successful builds artifacts) with this (running build) build artifact. How do I get related artifact of a build (a successful build should return its artifact, not all previous successfull artifacts). Any suggestions or ideas ?</p>