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

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

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          knielse1 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>

          Show
          knielse1 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>
          Hide
          wongherlung Delon Wong added a comment - - edited

          Hey Catalin Luta, 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.

          Show
          wongherlung Delon Wong added a comment - - edited Hey Catalin Luta , 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.
          Hide
          aashish89 Aashish Rajguru added a comment -

          Hey kevin nielsen 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

          Show
          aashish89 Aashish Rajguru added a comment - Hey kevin nielsen  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
          Hide
          ardagan 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.

          Show
          ardagan 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.
          Hide
          manus manus added a comment -

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

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

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

            People

            • Assignee:
              catalinluta Catalin Luta
              Reporter:
              aashish89 Aashish Rajguru
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: