Collect reporting data with the Jira (PDK) plugin

5 minute readExtensibilityDeveloper productivity

This plugin provides integration with CloudBees Analytics reports and/or dashboards to focus on key metrics across releases and pipelines - from code commit to deployment. The ability to visualize this information as dashboards enables enterprises to understand the overall status of their release and deployment process, identify hotspots that require action, understand trends, and find opportunities for further improvement.

You can create reports and dashboards by adding data sources for different external tools you are using in your release. The supported tools are based on the installed plugins that support collecting data for the dashboard to send to the CloudBees Analytics server. For more information, refer to Monitoring with CloudBees Analytics.

Defect

Collects defect-related reporting data from Jira to use in CloudBees Analytics dashboards and reports.

Input parameters

Table 1. Defect input parameters
Parameter Description

Filter type

Required. Type of Jira filter, either JQL or field.

JQL filter

JQL to filter issues. For example, project = MYPROJ AND issuetype = Bug retrieves all Bug tickets for the specified project. Refer to the Jira JQL documentation for help.

For this field, the issuetype must be Bug, or the equivalent defect issue type in your project.

Project key

The Jira project key. NOTE: This is not the same as the name of the project, but the prefix that appears before issues in the project. For example, if you have an issue such as PROJ-1234, the project key is PROJ.

Jira Fix Version

The Jira Fix Version for issues that are part of the release.

Field mapping

Jira fields that identify issues associated with a release (for example, fixVersions.name:releaseName, projectName:releaseProjectName) in the reporting system. The record projectName:releaseProjectName means the projectName field from a Jira issue is mapped to the releaseProjectName field in the reporting system. For more information, refer to Retrieve summary data.

Fields to aggregate

Jira fields to aggregate. For each group based on the Status field, and additionally grouped by other fields, the sum of each specified field is calculated and stored as a separate field. These fields are expected to be numeric fields. Fields can also be specified as strings (for example, fieldName:featureFieldName, in which case the value is stored as featureFieldName). For more information, refer to the Retrieve summary data.

Allow missing fields

If selected, and the Fields to aggregate parameter has missing fields, the value is considered to be 0. If the Field mapping parameter has missing fields, the value is set to null.

Metadata property path

Property sheet where run metadata is stored. If omitted, /mySchedule/Jira-%JobName%-%Report Object Type% is used for schedule contexts. For all other contexts, the root is /myProject.

Feature

Collects feature-related reporting data from Jira to use in CloudBees Analytics dashboards and reports.

Input parameters

Table 2. Feature input parameters
Parameter Description

Filter type

Required. Type of Jira filter, either JQL or field.

JQL filter

JQL to filter feature issues. For example, project = MYPROJ AND issuetype = Story retrieves all Story issues for the specified project. Refer to the Jira JQL documentation for help.

For this field, the issuetype needs to be Story, New Feature, or Improvement, or the equivalent issue types in your project.

Jira project

The Jira project key. NOTE: This is not the same as the name of the project, but the prefix that appears before issues in the project. For example, if you have an issue such as PROJ-1234, the project key is PROJ.

Jira Fix Version

The Jira Fix Version for issues that are part of the release.

Field mapping

Jira fields that identify issues associated with a release (for example, fixVersions.name:releaseName, projectName:releaseProjectName) in the reporting system. The record projectName:releaseProjectName means the projectName field from a Jira issue is mapped to the releaseProjectName field in the reporting system. For more information, refer to Retrieve summary data.

Fields to aggregate

Jira fields to aggregate. For each group based on the Status field, and additionally grouped by other fields, the sum of each specified field is calculated and stored as a separate field. These fields are expected to be numeric fields. Fields can also be specified as strings (for example, fieldName:featureFieldName, in which case the value is stored as featureFieldName). For more information, refer to Retrieve summary data.

Allow missing fields

If selected, and the Fields to aggregate parameter has missing fields, the value is considered to be 0. If the Field mapping parameter has missing fields, the value is set to null.

Metadata property path

Property sheet where run metadata is stored. If omitted, /mySchedule/Jira-%JobName%-%Report Object Type% is used for schedule contexts. For all other contexts, the root is /myProject.

Retrieve summary data

To retrieve summary data, such as the sum of storyPoints in the grouped issues, the Fields to aggregate parameter must be specified. If the parameter is left empty, each issue is sent as a separate report payload. Any field with numeric data can be used in this parameter. The most commonly used fields are:

  • storyPoints: Story points for the issues (for examples, stories or epics).

  • timeEstimate: Estimated time for the issue.

A refined issue may be similar to the following:

View retrieve summary example:
$VAR1 = { 'acceptancecriteria' => undef, 'aggregateprogressprogress' => '', 'aggregateprogresstotal' => '', 'aggregatetimeestimate' => undef, 'aggregatetimeoriginalestimate' => undef, 'aggregatetimespent' => undef, 'assigneeactive' => 'true', 'businessvalue' => undef, 'components' => [], 'created' => '2017-07-10T08:52:04.000-0700', 'creatoractive' => 'true', 'creatorname' => 'name', 'customer' => undef, 'customeremail' => undef, 'description' => undef, 'docimpactid' => '10850', 'docimpactvalue' => 'Not Set', 'duedate' => '2017-07-12', 'engcategory' => undef, 'environment' => undef, 'epic/theme' => undef, 'epiclink' => undef, 'fixversions' => [ { 'archived' => bless( do{\(my $o = 0)}, 'JSON::XS::Boolean' ), 'id' => '16703', 'name' => '1.0.0', 'released' => $VAR1->{'fixversions'}[0]{'archived'}, 'self' => 'http://some-jira.company.com/rest/api/2/version/16703' } ], 'flagged' => undef, 'id' => '80952', 'installerimpactid' => '10851', 'installerimpactself' => 'http://some-jira.company.com/rest/api/2/customFieldOption/10851', 'installerimpactvalue' => 'Not Set', 'issuelinks' => [], 'issuetypedescription' => 'Test jira', 'issuetypeiconurl' => 'http://some-jira.company.com/images/icons/issuetypes/story.png', 'issuetypeid' => '9', 'issuetypename' => 'Story', 'issuetypeself' => 'http://some-jira.company.com/rest/api/2/issuetype/9', 'issuetypesubtask' => '', 'key' => 'ECJIRA-12', 'keywords' => undef, 'labels' => [], 'lastviewed' => '2017-07-13T06:37:53.720-0700', 'milestoneid' => '10872', 'milestoneself' => 'http://some-jira.company.com/rest/api/2/customFieldOption/10872', 'milestonevalue' => 'Unassigned', 'operatingsystem' => [ { 'id' => '10031', 'self' => 'http://some-jira.company.com/rest/api/2/customFieldOption/10031', 'value' => 'All' } ], 'perforcejob' => 'true', 'priorityiconurl' => 'http://some-jira.company.com/images/icons/P2.gif', 'priorityid' => '2', 'priorityname' => 'P2', 'priorityself' => 'http://some-jira.company.com/rest/api/2/priority/2', 'progress' => '', 'progresstotal' => '', 'projectcategoryid' => '10030', 'projectcategoryname' => 'Sample project', 'projectcategoryself' => 'http://some-jira.company.com/rest/api/2/projectCategory/10030', 'projectid' => '12770', 'projectkey' => 'ECJIRA', 'projectname' => 'Jira Plugin', 'projectself' => 'http://some-jira.company.com/rest/api/2/project/12770', 'rank' => '1|i034ev:', 'rank(obsolete)' => '9223372036854775807', 'releaseversionhistory' => undef, 'reporteractive' => 'true', 'reporterdisplayname' => 'Someone', 'reporteremailaddress' => 'someone@mycompany.com', 'reportername' => 'Someone', 'resolution' => undef, 'resolutiondate' => undef, 'self' => 'http://some-jira.company.com/rest/api/2/issue/80952', 'severityid' => '10003', 'severityself' => 'http://some-jira.company.com/rest/api/2/customFieldOption/10003', 'severityvalue' => 'normal', 'sprint' => undef, 'statuscategorycolorname' => 'blue-gray', 'statuscategoryid' => '2', 'statuscategorykey' => 'new', 'statuscategoryname' => 'New', 'statuscategoryself' => 'http://some-jira.company.com/rest/api/2/statuscategory/2', 'statusdescription' => 'The issue is open and ready for the assignee to start work on it.', 'statusiconurl' => 'http://some-jira.company.com/images/icons/statuses/open.png', 'statusid' => '1', 'statusname' => 'Open', 'statusself' => 'http://some-jira.company.com/rest/api/2/status/1', 'subtasks' => [], 'summary' => 'Sample jira with delivery date', 'timeestimate' => undef, 'timeoriginalestimate' => undef, 'timespent' => undef, 'updated' => '2017-07-13T06:37:53.000-0700', 'versions' => [], 'votes' => '', 'voteshasvoted' => '', 'votesself' => 'http://some-jira.company.com/rest/api/2/issue/ECJIRA-12/votes', 'watchesiswatching' => 'true', 'watchesself' => 'http://some-jira.company.com/rest/api/2/issue/ECJIRA-12/watchers', 'watcheswatchcount' => '1', 'workratio' => -1 };

To put a top-level field into a payload, simply use its name (for example, projectkey:projectKey). To put a value from an array, use the dot syntax: operatingsystem.value:operatingSystem, which results in {"operatingSystem": "All"} in the payload.