Defect Tracking

3 minute readAutomation

The Defect Tracking plugin enables linking existing defects to a CloudBees CD/RO job. "Existing defects" are those defects previously created in the defect tracking system and already associated with the CloudBees CD/RO job in some way.

For example, a defect is associated with a CloudBees CD/RO job if the fix for the defect is part of the source code snapshot being built and tested in the job.

CloudBees CD/RO pre-installs numerous defect tracking plugins including Bugzilla, ClearQuest, Fortress, JIRA, Quality Center, Ration Team Concert, Rally, Team Foundation Server, TeamForge, TestTrack, and more, using plugin integrations.

The following examples and instructions are for a JIRA integration. The steps for other defect tracking systems are similar to those for JIRA.

Scenario Example

A developer fixes a defect in the "ABC" project and checks in the fix to the source control system, along with a comment that includes the fixed defect ID, for example:

ABC-123: fixed EFG bug

When the next CloudBees CD/RO job is triggered for the ABC project, CloudBees CD/RO checks out a source code snapshot from the source control system and queries the source control system for a log containing check-in details. This log, which should contain the above comment, will be stored in a property on the job. The JIRA plugin will then do the following:

  • Parse the property containing the source control system log to identify defect IDs.

  • Query the configured JIRA server with identified defect IDs, including "ABC-123".

  • Construct a descriptive URL to point to the JIRA defect on the JIRA server.

  • Include the URL in the JIRA Report.

  • Link to this JIRA Report from the Job Details page.

Enabling the JIRA Integration in Your Procedure

To ensure CloudBees CD/RO links existing defects to a job, create a step to link the defects.

Go to Projects > select a Project > select a Procedure. To create a New Step, select the Plugin link.

  • In the Choose Step panel, select Defect Tracking from the left pane, then select the defect tracking system you configured.

  • The right pane now shows the types of steps available for your configuration. Select the step you need and automatically go to the New Step page.

  • On the New Step page, notice the Subprocedure section now contains the defect tracking integration you configured and the step you chose.

On the New Step page, enter information in the following fields:

Field or Option Description

Name

Unique name for your subprocedure step (any name of your choice).

Description

(Optional) Plain text or HTML description for this object. If using HTML, you must surround your text with <html> …​ </html> tags. Allowable HTML tags are <a>, <b>, <br>, <div>, <dl>, <font>, <i>, <li>, <ol>, <p>, <pre>, <span>, <style>, <table>, <tc>, <td>, <th>, <tr>, and <ul>.

  • For example, the following HTML:

    <p> <span style="font-family: Arial;"> <i>Note:</i> For more information about the <b>abc</b> object, see <a href="https://www.google.com/">https://www.google.com</a>. </span> </p>

    renders as follows:

    <i>Note</i>: For more information about the <b>abc</b> object, see https://www.google.com.

Subprocedure

(Optional) Name of a procedure to invoke during this step.

Resource

(Optional) Resource to run the procedure.

Configuration Name

Name of the Defect Tracking configuration you created on the New Defect Tracking Configuration page.

If you did not create a Defect Tracking configuration, you must do that now before you proceed. Click Administration > Defect Tracking > Create Configuration to see the New Defect Tracking Configuration page. You can click the Help link on that page for details.

Prefix

Key used by JIRA as the prefix for defects within a project. If this field is blank, a regular expression is used to match defect IDs.

Property To Parse

Property or property sheet to search for defect IDs. If the this field is blank, the default property /myJob/ecscm_changeLogs is used.

Precondition

(Optional) A fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a \"0\", or a \"false\" is interpreted as FALSE. Any other result string is interpreted as TRUE. The step will block until the precondition is TRUE.

Run Condition

(Optional) A fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a \"0\", or a \"false\" is interpreted as FALSE. Any other result string is interpreted as TRUE. If the run condition is false once the step meets its precondition, the step is skipped.

The following screen is an example of the New Step page where you will create your Defect Tracking subprocedure step.

820