#' jira_sprint_days
#'
#' Calculate the average number of days per ticket in each status in the sprint
#' @param x The sprint dataframe
#' @param cols A string or vector of strings of named columns to group by - 'change_from' is automatically part of the grouping, so leave it out
#' @seealso \code{\link{jira_sprint_review}} which creates the underlying data set
#' @export
jira_sprint_days <- function(x,cols) {
require(tidyverse)
#add the new columns
if (is_empty(cols) == FALSE) {
cols_to_group <- c('change_from',cols)
} else {
cols_to_group <- 'change_from'
}
status_summary <- x %>%
#get rid of the rows with missing data
filter(!is.na(change_from)) %>%
group_by_(.dots = cols_to_group) %>%
summarize(tickets = n_distinct(issue),
avg_days_in_status = round(sum(days_difference) / tickets,3)) %>%
ungroup() %>%
rename(status = 1)
return(status_summary)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.