How to show the results in days instead of hours when changing the Y-axis in the Time from Status to Status report in the Dataplane app

This article explains how to show the result in days instead of hours when changing the Y-axis in the Time-from-Status to Status report.

 Instructions

  1. Login to Jira as Jira Administrator.

  2. Go to Dataplane Reports.

  3. Create the Time from Status to Status report.

  4. Select a period as per requirement.

  5. Search Projects, Categories, Boards, and Filters, or use JQL as needed.

  6. Select From Status and To Status as per requirement.

  7. Select the Segment by as needed.

     

  8. Compose the script below to obtain results in days instead of hours.

    def AVE_COLUMN_NAME = "stat_ave" def MAX_COLUMN_NAME = "stat_max" def MIN_COLUMN_NAME = "stat_min" def AVE_DAYS_NAME = "Ave Days" def MAX_DAYS_NAME = "Max Days" def MIN_DAYS_NAME = "Min Days" Double HOURS_PER_DAY = 24 Double ZERO_DAYS = 0 def convertToDays = { Matrix report, int row, DataColumn column -> Double val = report.getValue(row, column) report.setValue(row, column, (val != null) ? (val / HOURS_PER_DAY) : ZERO_DAYS) } customizeResult { // get the results data and stat columns for this report def report = getMatrix() def aveColumn = report.getColumnByName(AVE_COLUMN_NAME) def maxColumn = report.getColumnByName(MAX_COLUMN_NAME) def minColumn = report.getColumnByName(MIN_COLUMN_NAME) // convert to days for (int row=0; row < report.rowCount(); row++) { convertToDays(report, row, aveColumn) convertToDays(report, row, maxColumn) convertToDays(report, row, minColumn) } } customizeChart { axis "range" title "Average Days" } customizeRender { stat "ave" title "Ave Days" stat "max" title "Max Days" stat "min" title "Min Days" }
  1. Run the report to get the desired result.