Create Issue

Rule action to create an issue in any project.

Project

Start typing the name of the project the issue should be created in and the options matching your text will appear.

Issue type

Selectable issue types will become available once you have selected a project.

Summary

Provide the summary for the issue.

Expression Values can be used here, e.g.  "Build [[build.displayName]] was not successful"

Description

Optionally provide the description for the new issue. Every separate lines with a blank line to separate lines into paragraphs.

Expression Values can be used here.


Advanced Fields

Advanced Fields is available under Advanced Options and allows you to change issue field values even if the field is not supported by this add-on.

Using the feature requires that you specify the field operations using the JSON format specified by the Jira REST API which contains two attributes namely fields and update.

{
  "fields": {
    "summary": "Build [[build.displayName]] was not successful"
  },
  "update": {
    "components": [{
      "add": [{ "id": "10000" }]
    }]
  }
}

Expression Values can also be used as shown in the example above.

Refer to the Jira Field input formats documentation for samples of different field types that can be used in this advanced fields JSON format.

Operations for the same field cannot co-exist in both fields and update sections of the JSON.


fields vs. update

fields is a shortcut for the update set  operation. Take the following JSON snippet.

{
  "fields": {
    "summary": "Build [[build.displayName]] was not successful"
  }
}

The summary can also be set using the update operation below.

{
  "update": {
    "summary": [{
      "set": "Build [[build.displayName]] was not successful"
    }]
  }
}

update can be useful when you want to add or remove a value from the field, or when you want to combine operations.

For example, lets say you want to update the field components by removing one component and adding two others, take the following snippet:

{
  "update": {
    "components": [
      {
        "remove": [{ "id": "10100" }]
      }, {
        "add": [{ "id": "10101" }, { "name": "Backend" }]
      }
    ]
  }
}

On line 5 we remove the component with the id 10100 and on line 7 we add two components,  one via its id namely 10101, and one via its name namely Backend.

Simpler is often better

When you want to simply set the value of a field, then prefer using the fields section of JSON, only opting for update when you want to use another operation like addremove or edit. This will keep your JSON easier on the eyes.

Editable Issue Fields

Only fields that are on the appropriate action screen, like create, edit, transition, can be edited through a Jenkins Integration Automation for Jira rule. If you specify a field that is not on the appropriate screen related to the action you are trying to execute, then the rule execution will fail and the reason for this will be shown in the rule log.

A good visual way to check if a rule can update a field is by opening the action yourself in Jira, e.g. to check if field ABC can be set when creating a bug in project XYZ, simple open the create issue screen in Jira for project XYZ and set the issue type to bug. Then if the field ABC is selectable on the screen then you can also set this via a rule.

An alternative method to check if the field in on the screen is to validate this through interpreting the JSON response from one of the following REST API's: