Rule action to create an issue in any project.
Start typing the name of the project the issue should be created in and the options matching your text will appear.
Selectable issue types will become available once you have selected a project.
Provide the summary for the issue.
Expression Values can be used here, e.g. "Build [[build.displayName]] was not successful"
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 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
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
update sections of the JSON.
fields is a shortcut for the
update set operation. Take the following JSON snippet.
The summary can also be set using the update operation below.
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:
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
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:
- For creating an issue:
- For editing an issue: http(s)://[YOUR_INSTANCE_ROOT]/rest/api/3/issue/[ISSUE_KEY]/editmeta
- For transitioning an issue: http(s)://[YOUR_INSTANCE_ROOT]/rest/api/3/issue/[ISSUE_KEY]/transitions?expands=transitions.fields, you will need to lookup the transition you want to inspect, if you know the transition id, then you can use this with the URL parameter