/
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
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
Login to Jira. Navigate to the Dataplane Report app, then select Reports.
Select the "User Work Logged by Date" report.
Select a Monthly time interval.
Search Projects, Categories, Boards, and Filters, or use JQL as needed.
Select the Segment by as Issue Type.
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)
}
Run the report to get the desired result.
Navigate to Data to view the data in the result.
Related content
How to use the Customizer Script to filter the currently logged user for the 'Issues Work Log Table' Report in the Dataplane App
How to use the Customizer Script to filter the currently logged user for the 'Issues Work Log Table' Report in the Dataplane App
More like this
Customizer Script to report User key information using User Work Logged by Date gadget in the Dataplane app
Customizer Script to report User key information using User Work Logged by Date gadget in the Dataplane app
More like this
How to use the Customizer script for Work Logged Team Filter in Dataplane app
How to use the Customizer script for Work Logged Team Filter in Dataplane app
More like this
How to filter report results to only those work log entries authored by specific users
How to filter report results to only those work log entries authored by specific users
More like this
Issue Values Snapshots by Date Report
Issue Values Snapshots by Date Report
More like this
Part 6 - Creating the team members page
Part 6 - Creating the team members page
More like this