CERT® JIRA Automated Task Creator (ATC)

The CERT® JIRA Automated Task Creator (ATC) can create any number of new JIRA issues based on a trigger. The trigger can either be the creation of a new issue or a workflow transition. The newly created issue's data is completely configurable, except for the project.

ATC was coded and tested using JIRA version 4.4.5.

Installation

Copy all of the JARs from this distribution's lib to directory to JIRA's lib directory (usually /opt/tomcat/webapps/jira/WEB-INF/lib)

Setting up JIRA

Create a Custom Field (will be stored in the Application.properties file)
  • Access "Administration | Custom Fields"
  • Click on "Add Custom Field"
  • Select "Read-only Text Field"
  • Enter a Name and Description
  • Click Finish
  • Select "Default Screen"
  • Click Update
Listener Setup (new issue creation trigger)
  • Access "Administration | Listeners"
  • Add a new listener
    • Name : Can be anything
    • Class : org.cert.cc.jira.atc.IssueEventEntryPoint
Workflow Transition Setup (post-transition step)
Note: In order to change a workflow, you will need to a create a Draft version of it.
  • Access "Administration | Workflow"
  • Select "Steps" for an existing Workflow
  • Select a "Transition"
  • Click on "Post-Functions"
    • Click on "Add a new post function"
    • Select "CERT Automated Task Creation"
    • Click "Add"
Sub-Task Administration
  • Access "Administration | Sub-Tasks"
  • Ensure that Sub-Tasks are enabled
Issue Linking Administration
  • Access "Administration | Issue Linking"
  • Ensure that Issue Linking is enabled

External properties files

Application.properties

Stored in /etc/certops-jira/atc/

For all boolean properties, if the key is missing the value will default to false. The Default column below will list the behavior when a key is missing.

KeyRequiredAllowed ValuesDefaultComments
use.workflowYesfalse,trueIssues will not be created due to a workflow transition.Boolean value. If true, the creation of issues will be triggered by a workflow transition
use.listenerYesfalse,trueBoolean value. If true, the creation of issues will be triggered by a workflow transitionBoolean value. If true, the creation of issues will be triggered by the creation of a new issue
duplicate.fields.checkNosummary, type, description, priority, Custom Field NameNo duplicate checking will be done. All issues will always be createdIf specified ATC will use this field to check for duplicate linked issues before creating them. Each field specified (comma separated) is checked on the existing linked issue and the new possible linked issue. For example: type,InternalTracking#,cert.creator,summary
cert.creator.customField.nameYesCustom Field NameNone. Required FieldName of the custom field defined above
default.issue.typeYesIssue Type name (or internal JIRA number)None. Required field.Defines the newly created issue type if one cannot be determined from the configuration
regex.matchFail.use.configurationValueNofalse,trueIf the regex fails to match, the source field value will be used to populate the new issueControls the value for the summary (or description) when the regex fails to match the input. If true, the template value (from the configuration file) is used. If false, the corresponding source field value is used.
creating.userNoJIRA Username (or email address)If the source issue's reporter is not specified, an error will occur.Fallback for the creating user. Be default, ATC uses the source issue's reporter. If there isn't a source reporter, this property is used as a fallback. If both are missing an error is reported and the new issue is not created.

configuration.xml

Stored in /etc/certops-jira/atc/

  • * is a catch-all. It can be used for either projects or issue types.
  • All values are case-sensitive.
  • All references to JIRA objects accept either the object's name or its identifier.
  • Pattern is a regex pattern match its source field. If the source attribute is not specified, the source is the parent issue's same field. Pattern uses the stanadrd Java regex engine; see the JavaDoc for details.
    • The template uses Java's MessageFormat class. See its JavaDoc for details on usage.
    • If pattern is not specified, the template is used as a plain text string.
    • If template equals INHERIT (case-sensitive), the field's value is inherited from the source issue's same field.
    • Any field can use can any source field as input. If the source is not specified, the same source field will be used.
    • All field names and source attributes are case-sensitive. They must be all lower case.
    • Summary and description configurations are required for all issues. The template value can be empty, but the configuration is required. If either field configuration is missing, an error will be written to the logs.
    • The acceptable values for trigger are: "listener", "workflow", and "listener,workflow"
    • Due date supported was added in version 1.5. The field name is duedate. It can take 3 different values:
      • (+|-)([0-9]+)d (e.g. +3d, -2d)
        a number of days from the source date. If the source attribute is set, the offset would be from that date, not today's date.
      • YYYY-MM-DD (e.g. 2010-12-10) an exact date
      • INHERIT inherits the source's issue source date
Example
<?xml version="1.0" ?>
<atc-configuration>
        <project name="Project1">
                <type name="Submission1" trigger="listener">
                        <issue>
                                <type link="Internal-Analysis">Analysis and Production</type>
                                <fields>
                                        <field name="reporter" source="assignee">
                                                <template>INHERIT</template>
                                        </field>
                                        <field name="assignee">
                                                <template>user1</template>
                                        </field>
                                        <field name="priority">
                                                <template>INHERIT</template>
                                        </field>
                                        <field name="InternalTracking#">
                                                <template>INHERIT</template>
                                        </field>
                                        <field name="summary">
                                                <pattern><![CDATA[([0-9]{5}-[0-9]{3})]]></pattern>
                                                <template><![CDATA[Analysis for {0}]]></template>
                                        </field>
                                        <field name="description">
                                                <template><![CDATA[Listener]]></template>
                                        </field>
                                </fields>
                        </issue>
                </type>

                <type name="Submission2" trigger="workflow">
                        <issue>
                                <type link="Sub-task">Sub-task</type>
                                <fields>
                                        <field name="reporter" source="assignee">
                                                <template>INHERIT</template>
                                        </field>
                                        <field name="assignee">
                                                <template>user2</template>
                                        </field>
                                        <field name="priority">
                                                <template>INHERIT</template>
                                        </field>
                                        <field name="InternalTracking#">
                                                <template>INHERIT</template>
                                        </field>
                                        <field name="summary">
                                                <pattern><![CDATA[([0-9]{5}-[0-9]{3})]]></pattern>
                                                <template><![CDATA[Please Review {0}]]></template>
                                        </field>
                                        <field name="description">
                                                <template><![CDATA[Review created.]]></template>
                                        </field>
                                </fields>
                        </issue>
                </type>
        </project>
</atc-configuration>