Gets the average cycletime of the current user for the past week.
        This includes any ticket that was marked "In Progress" but not reopened.

def get_week_avg_cycletime(self):
        """
        Gets the average cycletime of the current user for the past week.
        This includes any ticket that was marked "In Progress" but not reopened.
        """
        def moving_average(new_val, old_avg, prev_n):
            return (new_val + old_avg) / (prev_n + 1)

        active_tickets_jql = 'assignee=currentUser() and status was "In Progress" DURING (startOfWeek(), endofweek()) and status not in (Backlog, Open) ORDER BY updated DESC'

        week_active_tickets = self.search_issues(active_tickets_jql)

        avg_cycletime = 0
        n_issues = 0
        for issue in week_active_tickets:
            cycle_time = self.get_cycle_time(self.get_issue(issue.key))
            avg_cycletime = moving_average(cycle_time, avg_cycletime, n_issues)
            n_issues = n_issues + 1

        return avg_cycletime