More about jiraGetComments step.

Overview

This step queries all comments on a particular issue.

Input

  • idOrKey - Issue id or key.
  • site - Optional, default: JIRA_SITE environment variable.
  • failOnError - Optional. default: true.

Note: For more information about input, please refer to the model objects in the api package.

Output

  • Each step generates generic output, please refer to this link for more information.
  • The api response of this jira_get_comments step can be reused later in your script by doing response.data.required_field_name.
  • You can see some example scenarios here
  • All the available fields for a jira response can be found in JIRA Api documentation depending on your JIRA version.

Note: response.data returns all the fields including custom fields added in customizing your JIRA.

Examples:

  • With default site from global variables.

    node {
      stage('JIRA') {
        def comments = jiraGetComments idOrKey: 'TEST-1'
        echo comments.data.toString()
      }
    }
    
  • withEnv to override the default site (or if there is not global site)

    node {
      stage('JIRA') {
        withEnv(['JIRA_SITE=LOCAL']) {
          def comments = jiraGetComments idOrKey: 'TEST-1'
          echo comments.data.toString()
        }
      }
    }
    
  • Without environment variables.

      def comments = jiraGetComments site: 'LOCAL', idOrKey: 'TEST-1'
      echo comments.data.toString()
    
Tags: steps