...
In your scripted report, data aggregation with Pivotopia could look like in example https://actonic.atlassian.net/wiki/spaces/ARB/pages/edit-v2/7177437201#Full-Scripted-Reports-example
Configuration
Where config could have different fields depending on the calculation type.
...
Calculation type | Description |
---|---|
matrix | A matrix ("pivot table") report type is a way to organize and display data in a two-dimensional grid or matrix format. It allows you to compare two sets of data by presenting them as rows and columns in a matrix. Each cell within the matrix represents the intersection of data from the respective row and column, making it easy to analyze relationships between these data points. Matrix reports are commonly used for comparing data across different dimensions, such as issue fields, worklog fields, comment fields, etc., providing a structured view of complex data for better insights and decision-making. |
list | "List" report type provides a tabular representation of issues with any existing or calculated fields. It's a way to display issue information in a structured and compact format, making it easier to view and work with a list of issues. Every row of the report represents a single issue. The core value lies in the ability to use calculated fields such as “Age (Business days since creation)”, “Effort Variance”, etc (see “Issue: Example list of calculated fields” below). |
number |
Matrix calculation type
...
A number report displays a single or multiple numeric values, such as a total spent time, average remaining estimate, or any other quantitative metric for a scope of issues. This report are straightforward and focus on presenting a specific number without additional visual elements. |
Matrix calculation type
For matrix calculation, at least one row and one measure is required.
Code Block | ||
---|---|---|
| ||
{ type: 'matrix'; rows: Dimension[]; cols?: Dimension[]; measures: Measure[]; orderBy?: OrderBy; } |
...
Dimensions are responsible for creating row headers and column headers Row Headers and Column Headers in Matrix report type, and for content cells in List report type.
...
Let's take a look at the configuration:
Code Block | ||
---|---|---|
| ||
{
type: 'matrix',
rows: [{ name: 'project' }, { name: 'issueType' }],
cols: [{ name: 'status' }],
measures: [{ name: 'countOfIssues' }],
}; |
This configuration will show a matrix report with project and issue type in rows and statuses in columns. Both rows and columns are Dimensions. So they represent Row Headers and Column Headers in the calculation result:
Drawio | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Group
Format
Filter
Dimension filters allow to
System Dimensions (Jira System fields)
...
Name | Display Name | Scheme | Type | CategoryStatus | Description | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| Count of Issues | Issue | Number | Count | ||||||||
colour | Green | IMPLEMETED | Counts issues regardless of their statuses | |||||||||
| Count of Opened Issues | Issue | Number | Count |
| Counts issues where issues | ||||||
| Count of Resolved Issues | Issue | Number | Count | ||||||||
colour | Green | IMPLEMETED | Counts issues where | |||||||||
| Count Of Status Changes | Issue | Number | Count |
| |||||||
colour | Green | title | IMPLEMETEDIssue | Number | Count | Counts number of times the issue changed its status | ||||||
| Sum of logged time | issue.worklog | Duration | Sum |
| |||||||
| Sum of Original Estimate | Issue | Duration | Sum | ||||||||
colour | Green | IMPLEMENTED | Sum of values from Original estimate field | |||||||||
| Sum of Time remaining | Issue | Duration | Sum |
| Sum of values from Time remaining field | ||||||
| Mean of Votes | Issue | Number | Sum | ||||||||
colour | Green | title | IMPLEMETED||||||||||
| Latest Issue Creation Date | Issue | Date | Date |
| |||||||
colour | Green | title | IMPLEMETEDDateIssue | Date | Date | Calculates the latest date of the issue creation in a selected scope of issues | ||||||
| Newest Issue Creation Date | Issue | Date | Date |
| Calculates the latest date of the issue creation in a selected scope of issues | ||||||
| Sum of Age (Business days) | Issue | Duration | Sum | ||||||||
colour | Green | IMPLEMENTED | Sum of “Age (Business days since creation)” calculated field values | |||||||||
| Sum of Age (Calendar days) | Issue | Duration | Sum |
| Sum of “Age (Calendar days since creation)” calculated field values | ||||||
| Sum of Business Days since last update | Issue | Duration | Sum | ||||||||
colour | Green | IMPLEMENTED | Sum of “Business Days since last update” calculated field values | |||||||||
| Sum of Calendar Days since last update | Issue | Duration | Sum |
| |||||||
colour | Green | title | IMPLEMENTEDSum | Sum of “Calendar Days since last update” calculated field values |
Format
Depending on the measure type, there could be a few possible formatting options.
OrderBy (result sorting)
Ordering configuration is a part of Pivotopia input parameters. Depending on which column we are using for sorting, it could look like:
...
Code Block | ||
---|---|---|
| ||
{
type: 'matrix',
rows: ['project'],
cols: ['issuetype'],
orderBy: {
orderType: 'totalColumn',
direction: 'desc',
colNum: 0,
},
measures: ['countOfIssues'],
}, |
...
'countOfIssues'],
}, |
ResultSet
ResultSet is a result object, which Pivotopia returns after the calculation. It consists of 6 elements:
Row Headers
Column Headers
Data Cells
Total Row
Total Column
Grand Total
Drawio | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Full Scripted Reports example
Code Block | ||
---|---|---|
| ||
... // initialization const pivotopia = await SR.pivotopia.getPivotopiagetInstance(); // aggregation configuration const config = { type: 'matrix', rows: [{ name: 'project' }], measures: [{ name: 'sumLoggedTime', }], }; // configuration validation const validatedConfig = pivotopia.getValidatedConfig(config); // get required jira fields, needed for the data aggregation const requiredFileds = pivotopia.getRequiredFieldsForConfig(validatedConfig); // get jira issues with required fields only const issues = await SR.getIssuesByJQL('created > -7d', requiredFileds.join(',')); // aggregate data const resultSet = await pivotopia.calculate(pivotopia.jiraIssuesToFlatObjects(issues), validatedConfig); // convert aggregation results to a html table const tableHtml = pivotopia.resultSetToHtmlTable(resultSet, validatedConfig); console.log(tableHtml); ... |
...