Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
# Overview
The cPrime Health Report is framework created in [Simple Issue Language™ (SIL)](https://confluence.cprime.io/pages/viewpage.action?pageId=6560282) and executed using [Power Scripts™ - Jira script automation](https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview). The report tool examines the user's current Jira system and evaluates it for areas improvement. By default, evaluations are performed Jira's out of the box checks, and additional basic agile principles. However, the Jira administrator as the ability to alter and increase the performed tests to better evaluate there individual system using tests that are more valuable to their individual team.

![Overview](ref/reportOverview.png)

To see a full report, PDF see [Full Health Report](ref/FullHealthReport.pdf)

---
---

# Prerequisites
- User needs to be a Jira admin
- Add on [Power Scripts™ - Jira script automation](https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview) needs to be installed.
  - Go to Jira Administration --> Add-ons --> **Find new apps** (or **Find new add-ons** in older versions or Jira).
  - In the search bar, search for *Power Scripts*.
  - Click the **Free trial** button to get a 30 day evaluation license for Power Scripts.
    - Clicking _Buy now_ will walk you through the process of acquiring a 1 year based license in accordance with your Jira instance.
  - Go to Jira Administration --> Add-ons --> SIL Manager to start using Power Scripts.
  - See [Power Scripts for Jira](https://anovaapps.atlassian.net/wiki/display/JJUPIN) documentation to learn more about Power Scripts.

# Quick Start
## Installation
![WARNING](ref/warning.png) Installation assumes that Jira is installed on a Unix/Linux system ![WARNING](ref/warning.png)
- Go to Jira Administration --> Add-ons --> SIL Manager
- Create a new file called **installation.sil** within silprograms
  - From the file panel, right click on _silprograms_ and click *New File*
  - Double click _silprograms_ to expand the directory.
- Copy the contents of the repository's **[installation.sil](installation.sil)** file into the newly created file of the same name in the SIL Manager
- Update the parameters on lines 4-7 to match your system:
  - adminUser       - An Jira admin username to use in advanced background calls in Jira
  - adminPass       - The password of the admin user
  - mainQuery       - The JQL used to drive the agile report. Example: "project in (TEST, DEMO)"
  - mainFilterId    - The query filter id used INSTEAD of 'mainQuery' Example: 23422
- Click the **Check** button, then the **Save** button
- Click the **Run** button
- Once execution finishes, click the **Refresh** button and a new directory should appear called __HealthReport__

![Datasource](ref/installation.png)


## Execute Health Report
- Go to Jira Administration --> Add-ons --> SIL Manager.
- From the file list, open silprograms/HealthReport/systemHealthCheck.sil.
- Click the **Run** button.
- A __Full__ report (all reports within the reports directory) will be sent to the user that executed the script.
  - The HTML output will also appear within the console to be copied into a file for viewing, if email is not configured.
  - A timestamped copy of the report will also be saved to silprograms/~ directory.
- Individual reports can be executed from the silprograms/HealthReport/reports directory.

---
---
# Advanced Installation
A System Integrity report is also available in the Health Report. It requires that Health Report be able to access Jira's database. Below are steps to update the configuration.

## Configure Database
- Go to Jira Administration --> Add-ons --> Datasources
- Click **+ Add Datasource**
- Fill in the __Create datasource__ screen with information about the Jira database
  - This information can be found in _JIRA HOME_/dbconfig.xml
- Click the **Test** button to test the configuration
- If there are no errors, click the **Save** button

![Datasource](ref/datasource.png)

## Update Installation to use Database
- Repeat the first 4 steps from [Installation](#installation)
- Update the following additional parameters
  - useDatabase       - Set to *true*. Determines if a database connection is required for installation of Health Report.
  - dataBaseType      - The type of database. Example: Postgres, MySQL, SQL Server, Other/
  - dataSourceName    - The name of the data source of a connection to the Jira database from [Configure Database](#configure-database).

## Advanced Configuration
Additional configurations can be done in the CSV files of the report. The CSV files exist in HealthReport/csvFiles. Updating the various CSV files allows administrators to
alter existing test queries, add additional tests, change the layout of the reports.

### CSV File Break down
- _configs.csv_: Main configuration file. Contains main query/filter information that can be used as global reuse in other CSV files queries.
  - **id**: Unique identifier of the configuration. Name can be used in other queries by using $_id of config_$. Example: $mainFilter$.
  - **name**: Name of the configuration .
  - **description**: Information about config.
  - **query**: Evaluation to use for the configuration. Typically a JQL query.
  - **type**: jql or sil. Query type. SIL will eventually execute a provided SIL script for test.
  - **filterId**: The id of a JQL filter. If this value is present it will be used instead of the query provided.
- _agileChecks.csv_: The tests to be run as part of the agile evaluation.
  - **id**: Unique identifier of the test.
  - **name**: Name of the test that appears in the report.
  - **query**: Evaluation to use for the test. Typically a JQL query.
  - **type**: jql or sil. Query type. SIL will eventually execute a provided SIL script for test.
  - **section**: The unique identifier the test should appear in the report. See sections.csv.
  - **metic**: The unique identifier of the metric used to evaluate the results of the query against. See metrics.csv.
- _metics.csv_: The evaluatation results used to determine if a test has passed or failed.
  - **id**: Unique identifier of the metric.
  - **name**: Name of the metric.
  - **query**: Main body of the metric. Either a JQL query OR a SIL script with parameters. If a SIL configuration, parameters can be passed by using "|" separators, where the first value is the location of the SIL script to run and all other values parameters required to execute the script. All SIL scripts MUST return a numeric value for evaluation.
    - _Example_: ./HealthReport/metricScripts/sprintMetric.sil|parmeter1|parameter2
  - **type**: States the type of metric. jql OR sil.
  - **value**: Default value of metric execution.
  - **lower_threshold**: Minimum value the metric must have to pass.
  - **upper_threshold**: Maximum value the metric can have to pass.
- _sections.csv_: Produces a section layout that tests will appear in a report. Report sections will appear in the order they appear in CSV.
  - **id**: Unique identifier of the section.
  - **name**: Name of the section as it appears in the report.
  - **description**: Information about section.  

## Test Advanced Configuration
Follow the steps from [Execute Health Report](#execute-health-report) to generate a new report with the updated configurations.