More about jiraNewComponent step.

Overview

Create new component based on given input, which should have some minimal information on that object.

New Component

Input

  • component - component to be created.
  • site - Optional, default: JIRA_SITE environment variable.
  • failOnError - Optional. default: true.
  • auditLog - Optional. default: true. Append the build url and build user name to the description.

Note: It supports all the fields that any jira instance supports including custom fields. For more information about all available input fields, please refer to the JIRA Api documentation depending on your JIRA version.

Output

  • Each step generates generic output, please refer to this link for more information.
  • The api response of this jira_get_new_component 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 returned by JIRA API.

Examples:

  • With default site from global variables.

    node {
      stage('JIRA') {
        def testComponent = [ name: 'test-component',
                              description: 'desc',
                              project: 'TEST' ]
        jiraNewComponent component: testComponent
      }
    }
    
  • withEnv to override the default site (or if there is not global site)

    node {
      stage('JIRA') {
        withEnv(['JIRA_SITE=LOCAL']) {
          def testComponent = [ name: 'test-component',
                                description: 'desc',
                                project: 'TEST' ]
          jiraNewComponent component: testComponent
        }
      }
    }
    
  • Without environment variables.

      def testComponent = [ name: 'test-component',
                            description: 'desc',
                            project: 'TEST' ]
      jiraNewComponent component: testComponent, site: 'LOCAL'
    
Tags: steps