title: Publish Jenkins Job build status to Gitlab commit from Jenkins
body: <p>I'm new to jenkins. I'm using Jenkins 2.77 and GitLab Enterprise Edition 9.5.5. I see a strange issue happening.</p>
  
  <p>I've created 3 Jenkins freestyle jobs and have built a pipeline view for those jobs <em>[1 ~> 2 ~> 3]</em>. I am able to trigger builds with Gitlab webhook and publish the status of job 3 to Gitlab without any issues . All these were done manually.</p>
  
  <p>I have to create these 3 jobs for about 100 projects. So I chose to generate these jobs via jenkins job DSL. I am able to generate the jobs and build a pipeline view. Also triggering the builds (for a particular project) from Gitlab webhook works fine. In the pipeline view I am able to see the builds too. But unfortunately due to some reason, I'm not getting feedback to Gitlab.</p>
  
  <p>The strange thing I observed is, if open the "job 3" in jenkins and just click save without even changing anything, it auto-magically sends the feedback from the next builds.</p>
  
  <p>I've no clue what is going on.</p>
  
  <p><strong>DSL of job 3:</strong></p>
  
  <pre><code>job("SyntaxCheck") {
  
  logRotator {
      numToKeep(10)
      artifactNumToKeep(10)
  }
  parameters {
      stringParam('jobType', '')
  }
  scm {
    git  {
      remote {
        url('gitlab url to checkout the project')
        branch('master')
        credentials(*********)
        extensions {
          submoduleOptions {
            recursive(true)
          }
        }
      }
    }
  }
  steps {
    shell(puppetparser)
  }
  publishers {
    gitLabCommitStatusPublisher {
      name('syntaxcheck')
      markUnstableAsSuccess(false)
    }
  }
  }
  </code></pre>
  
  <p>Suggestions or workarounds would be appreciated.</p>