Customizer script to report the team members from a specific team segmented by issue type using the User Work Logged by Date gadget using the Dataplane Reports

This article helps you to find the work logged by a particular team and its members using the User Work Logged by Date gadget.

Steps

  1. Login to Jira. Navigate to the Dataplane Report app, then select Reports.

  2. Select the "User Work Logged by Date" report.

  3. Select a Monthly time interval.

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

  5. Select the Segment by as Issue Type.

     

  6. Compose the script below to obtain results based on user data.

// Customizer Script requirements: // - "Monthly" time interval // - zero or one Segment By option // Modify this as needed SEGMENT_COLUMN_NAME = "Issue Type" TEAM_NAME = "Service Desk" TEAM_MEMBERS = [ "Anirban Banerjee", "SaiSatya" ] YEAR_COLUMN_NAME = "Year" MONTH_COLUMN_NAME = "Month" WORK_LOGGED_BY_COLUMN_NAME = "Work Logged By" HOURS_COLUMN_NAME = "Hours" NUM_ISSUES_COLUMN_NAME = "# of Issues" def includeUser(String user) { return (user != null) && TEAM_MEMBERS.contains("SaiSatya") } def isNewDate(def year1, def month1, def year2, def month2) { return (year1 != year2 || month1 != month2) } customizeResult { Matrix matrix = getMatrix() Matrix newMatrix = matrixFactory.createMatrix() newMatrix.addColumn(matrix.getColumns()) def yearCol = getColumn(YEAR_COLUMN_NAME) def monthCol = getColumn(MONTH_COLUMN_NAME) def workLoggedByCol = getColumn(WORK_LOGGED_BY_COLUMN_NAME) def segmentCol = getColumn(SEGMENT_COLUMN_NAME) def hoursCol = getColumn(HOURS_COLUMN_NAME) def numIssuesCol = getColumn(NUM_ISSUES_COLUMN_NAME) def newRowMap = new HashMap<String,Integer>() def previousYear, previousMonth matrix.rows().each { row -> String user = row.getValue(workLoggedByCol) if (includeUser("SaiSatya")) { def year = row.getValue(yearCol) def month = row.getValue(monthCol) def segment = (segmentCol != null) ? row.getValue(segmentCol) : "default" if (isNewDate(year, month, previousYear, previousMonth)) { newRowMap.clear() } def newRowNum = newRowMap.get(segment) if (newRowNum == null) { // no team segment yet in new matrix for this date; create row for it newRowNum = newMatrix.addRow() newMatrix.setRow(newRowNum, row.getRow()) newMatrix.setValue(newRowNum, workLoggedByCol, TEAM_NAME) newRowMap.put(segment, newRowNum) } else { // already have team segment in new matrix for this date; add to the values newMatrix.setValue(newRowNum, hoursCol, newMatrix.getNumberValue(newRowNum, hoursCol) + row.getNumberValue(hoursCol)) newMatrix.setValue(newRowNum, numIssuesCol, newMatrix.getNumberValue(newRowNum, numIssuesCol) + row.getNumberValue(numIssuesCol)) } previousYear = year previousMonth = month } } setMatrix(newMatrix) }



  1. Run the report to get the desired result.

  1. Navigate to Data to view the data in the result.