Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51243

Use JiraTestReporter plugin in Jenkins pipeline(Groovy) type of job.

      We are using pipeline type of jobs in jenkins so can we use JiraTestResultReporter plugin for pipeline type jobs?

      Is pipeline supported for JiraTestResultReporter plugin? If yes how can we use it in our pipeline job.

          [JENKINS-51243] Use JiraTestReporter plugin in Jenkins pipeline(Groovy) type of job.

          Hi Catalin,

          With JDK version 8 it is working fine. I was trying to compile it with JDK version 10.

          Aashish Rajguru added a comment - Hi Catalin, With JDK version 8 it is working fine. I was trying to compile it with JDK version 10.

          Hi Catalin,

          After i install the JiraTestResultReporter.hpi file and reboot Jenkins will the snippet generator work?

          Aashish Rajguru added a comment - Hi Catalin, After i install the JiraTestResultReporter.hpi file and reboot Jenkins will the snippet generator work?

          Hi Catalin,

          Your fix is working great i was able to use the plugin in my pipeline Job. Thanks for your help.

           

          Aashish Rajguru added a comment - Hi Catalin, Your fix is working great i was able to use the plugin in my pipeline Job. Thanks for your help.  

          manus added a comment -

          Thanks catalinluta and andreituicu for your work on this!

          I see there's a branch for the fix, but no pull request. Was there a problem, or can this be merged & released soon? Thanks again!

          manus added a comment - Thanks catalinluta and andreituicu for your work on this! I see there's a branch for the fix , but no pull request. Was there a problem, or can this be merged & released soon? Thanks again!

          kevin nielsen added a comment - - edited

          Hey, Caitlyn and Aashish Rajguru,  I'm trying to test out the workaround 

          I downloaded the git repo from https://github.com/jenkinsci/JiraTestResultReporter-plugin and I ran mvn hpi:hpi and it successfully created the hpi file, i then imported it into jenkins via jenkins plugin gui(located in advanced tab) and set up the JiraTest parameters in the settings

           

          Do you have an example of the code that works to run this plugin in a pipeline? I've tried the code below and it gets an unable to initialize object error

              <code>

          junit (
          testResults: '*/surefire-reports/.xml',
          testDataPublishers: [
          [$class: 'JiraTestDataPublisher',
          configs: [
          [$class: 'StringFields', fieldKey: 'Summary', value: 'Test Summary'],
          [$class: 'StringFields', fieldKey: 'Description', value: 'Test description.'],
          ],
          projectKey: 'NTS',
          issueType: '1',
          autoRaiseIssue: true,
          autoResolveIssue: false,
          autoUnlinkIssue: false,
          ],
          ])   

          </code>

          kevin nielsen added a comment - - edited Hey, Caitlyn and Aashish Rajguru,  I'm trying to test out the workaround  I downloaded the git repo from https://github.com/jenkinsci/JiraTestResultReporter-plugin  and I ran mvn hpi:hpi and it successfully created the hpi file, i then imported it into jenkins via jenkins plugin gui(located in advanced tab) and set up the JiraTest parameters in the settings   Do you have an example of the code that works to run this plugin in a pipeline? I've tried the code below and it gets an unable to initialize object error     <code> junit ( testResults: '* /surefire-reports/ .xml', testDataPublishers: [ [$class: 'JiraTestDataPublisher', configs: [ [$class: 'StringFields', fieldKey: 'Summary', value: 'Test Summary'] , [$class: 'StringFields', fieldKey: 'Description', value: 'Test description.'] , ], projectKey: 'NTS', issueType: '1', autoRaiseIssue: true, autoResolveIssue: false, autoUnlinkIssue: false, ], ])    </code>

          Delon Wong added a comment - - edited

          Hey catalinluta, I've too tested the fix https://github.com/jenkinsci/JiraTestResultReporter-plugin/tree/issue/JENKINS-51243 and it seems to work great! When could we see this get a PR merged? Thanks a lot.

          Delon Wong added a comment - - edited Hey catalinluta , I've too tested the fix https://github.com/jenkinsci/JiraTestResultReporter-plugin/tree/issue/JENKINS-51243  and it seems to work great! When could we see this get a PR merged? Thanks a lot.

          Hey knielse1 below is the code snippet that works for me.

          junit (
          testResults: '*/test-automation/config/.xml',
          testDataPublishers: [
          [$class: 'JiraTestDataPublisher',
          configs: [
          [$class: 'StringFields', fieldKey: 'Summary', value: 'Test Summary'],
          [$class: 'StringFields', fieldKey: 'Description', value: 'Test description.'],
          ],
          projectKey: 'CS',
          issueType: '10006', // "Bug" type
          autoRaiseIssue: false,
          autoResolveIssue: false,
          autoUnlinkIssue: false,
          ],
          ])

           

          Thanks

          Aashish Rajguru added a comment - Hey knielse1  below is the code snippet that works for me. junit ( testResults: '* /test-automation/config/ .xml', testDataPublishers: [ [$class: 'JiraTestDataPublisher', configs: [ [$class: 'StringFields', fieldKey: 'Summary', value: 'Test Summary'] , [$class: 'StringFields', fieldKey: 'Description', value: 'Test description.'] , ], projectKey: 'CS', issueType: '10006', // "Bug" type autoRaiseIssue: false, autoResolveIssue: false, autoUnlinkIssue: false, ], ])   Thanks

          Hi,

          I'm new to Jenkins. Can we also check that this works with [Job DSL](https://wiki.jenkins.io/display/JENKINS/Job+DSL+Plugin)? I believe functionality should be similar.

          Thanks.

          Mikhail Gryzykhin added a comment - Hi, I'm new to Jenkins. Can we also check that this works with [Job DSL] ( https://wiki.jenkins.io/display/JENKINS/Job+DSL+Plugin)? I believe functionality should be similar. Thanks.

          manus added a comment -

          Hello! I created a pull request based off the andreituicu's branch here:
          https://github.com/jenkinsci/JiraTestResultReporter-plugin/pull/13

          Please feel free to review, merge, and release when you see fit!
          (cc: catalinluta)

          manus added a comment - Hello! I created a pull request based off the andreituicu 's branch here: https://github.com/jenkinsci/JiraTestResultReporter-plugin/pull/13 Please feel free to review, merge, and release when you see fit! (cc: catalinluta )

          Christian added a comment -

          Christian added a comment - Available since JiraTestResultReporter-2.0.15

            catalinluta Catalin Luta
            aashish89 Aashish Rajguru
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: