title: How to p4 reconcile and p4 submit in Jenkins groovy
body: <p>There is an option to run p4 reconcile via Jenkins pipeline and if there where made changes to submit them(p4 publish)?</p>
  
  <p>realization examples if you have some please</p>
  
  <p>Edit:</p>
  
  <p>my question is how to run in p4 reconcile on my workspace and then if there made changes to submit them. according to <a href="https://wiki.jenkins.io/display/JENKINS/P4+Plugin" rel="nofollow noreferrer">p4 plugin for jenkins</a> which allows "Submit assets back to Perforce Helix (Publish)" (thats why i wrote p4 publish and meant p4 submit) but they didn't mentioned p4 reconcile.</p>
  
  <p>I'm using the following in my code which sync the latest version files in stream workspace:</p>
  
  <pre><code>line_ending = isUnix()  ? 'UNIX' : 'WIN'
  checkout([
      $class: 'PerforceScm', 
      credential: '*****************************',
      filter: [[$class: 'FilterPathImpl', path: '//Automation']],
      populate: [$class: 'AutoCleanImpl', delete: false, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', path: '/usr/local/bin/p4', threads: '4'], pin: '', quiet: true, replace: true], 
      workspace: [$class: 'ManualWorkspaceImpl', charset: 'none', name: "JENKINS-${NODE_NAME}", pinHost: false, spec: [allwrite: false, clobber: false, compress: false, line: line_ending, locked: true, modtime: false, rmdir: true, 
      streamName: '//&lt;Stream_name&gt;/name/...', 
      view: """
  &lt;Depot_path_to_sync&gt;/...\t//JENKINS-${NODE_NAME}/&lt;Depot_path_to_sync&gt;/...
  &lt;Depot_path_to_sync&gt;/...\t//JENKINS-${NODE_NAME}/&lt;Depot_path_to_sync&gt;/..."""]]
  ])
  </code></pre>
  
  <p>didn't tried to the submit via jenkins yet but i could find documentation on it so i will probably handle it, but, for reconcile I couldn't find so i asked for a reconcile example from someone here. I believe that it comes with submit so it may shortage my debugging time.</p>