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

How to retrieve JIRA task status using jira-steps-plugin

    XMLWordPrintable

Details

    Description

      How I can get the status of a Jira task using jira-steps-plugin. 

      I have created a Jira task from Jenkins pipeline script and latter I want to retrieve the status of that task to continue further steps in my pipeline. 

      For example, when the task is updated as DONE, I need to trigger the deployment stage in my pipeline.

       

      This is what I used to create the task:

      node {
        stage('JIRA') {
          def testIssue = [fields: [ project: [key: 'PROJECT'],
                                       summary: 'New JIRA Created from Jenkins -       Summery.',
                                       description: 'New JIRA Created from Jenkins - Description.',
                                       issuetype: [name: 'Task']]]      response = jiraNewIssue issue: testIssue, site: 'JIRA'      echo response.successful.toString()
            echo response.data.toString()
          }
      }
      

       

       

      Attachments

        Activity

          hhkkss hhkkss created issue -
          hhkkss hhkkss made changes -
          Field Original Value New Value
          Description How I can get the status of a Jira task using [jira-steps-plugin. |https://issues.jenkins-ci.org/issues/?jql=project+%3D+JENKINS+AND+component+%3D+jira-steps-plugin]

          I have created a Jira task from Jenkins pipeline script and latter I want to retrieve the status of that task to continue further steps in my pipeline. 

          For example, when the task is updated as DONE, I need to trigger the deployment stage in my pipeline.
          {code:java}
          node {
            stage('JIRA') {
              def testIssue = [fields: [ project: [key: 'PROJECT'],
                                           summary: 'New JIRA Created from Jenkins - Summery.',
                                           description: 'New JIRA Created from Jenkins - Description.',
                                           issuetype: [name: 'Task']]] response = jiraNewIssue issue: testIssue, site: 'JIRA' echo response.successful.toString()
                echo response.data.toString()
              }
          }
          {code}
           

           
          How I can get the status of a Jira task using [jira-steps-plugin. |https://issues.jenkins-ci.org/issues/?jql=project+%3D+JENKINS+AND+component+%3D+jira-steps-plugin]

          I have created a Jira task from Jenkins pipeline script and latter I want to retrieve the status of that task to continue further steps in my pipeline. 

          For example, when the task is updated as DONE, I need to trigger the deployment stage in my pipeline.

           

          This is what I used to create the task:
          {code:java}
          node {
            stage('JIRA') {
              def testIssue = [fields: [ project: [key: 'PROJECT'],
                                           summary: 'New JIRA Created from Jenkins - Summery.',
                                           description: 'New JIRA Created from Jenkins - Description.',
                                           issuetype: [name: 'Task']]] response = jiraNewIssue issue: testIssue, site: 'JIRA' echo response.successful.toString()
                echo response.data.toString()
              }
          }
          {code}
           

           
          hhkkss hhkkss made changes -
          Issue Type Task [ 3 ] Bug [ 1 ]
          nrayapati Naresh Rayapati made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            nrayapati Naresh Rayapati
            hhkkss hhkkss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: