Class BurndownChangeUtil
java.lang.Object
com.atlassian.greenhopper.web.rapid.chart.burndown.BurndownChangeUtil
Utilities for working with BurndownChange objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addColumnChanges
(org.joda.time.DateTime startDate, org.joda.time.DateTime endDate, SortedMap<Long, Map<String, IssueColumnChangeEntry>> columnChanges, Map<String, List<BurndownChange>> changesPerIssue, boolean trimIntraColumnMoves) Adds column changes to the list of changes per issuestatic void
addEpicHistoryChanges
(Map<String, List<EpicLinkHistoryEntry>> epicHistory, HashMap<String, List<BurndownChange>> changes) static void
addSprintHistoryChanges
(org.joda.time.DateTime sprintStart, org.joda.time.DateTime upperTimeRange, Map<String, List<SprintHistoryEntry>> sprintHistory, Map<String, List<BurndownChange>> changesPerIssue) Adds sprint history changes to the list of burndown changes per issuestatic void
addStatisticsValueChanges
(org.joda.time.DateTime sprintStart, org.joda.time.DateTime upperTimeRange, Map<String, List<StatisticHistoryEntry>> statisticsValueHistory, Map<String, List<BurndownChange>> changesPerIssue) Adds statistics field value changes to the list of changes per issuestatic void
addTimeTrackingChanges
(org.joda.time.DateTime sprintStart, org.joda.time.DateTime upperTimeRange, Map<String, List<TimeTrackingHistoryService.HistoryEntry>> timeTrackingHistory, Map<String, List<BurndownChange>> changesPerIssue) static void
addVersionHistoryChanges
(Map<String, List<FixVersionChangeEntry>> history, HashMap<String, List<BurndownChange>> changes) static Map
<String, List<SprintHistoryEntry>> filterSprintHistoryEntriesBeforeSprintActivated
(Sprint sprint, Map<String, List<SprintHistoryEntry>> sprintHistoryMap) Given a sprint and a map of issue to list of sprint history entries, this function will remove any sprint history entries for an issue where it is added and then removed from the sprint before the sprint has been activated.static String
getProfileLinkFromUserKey
(com.atlassian.jira.plugin.userformat.UserFormats userFormats, String userKey) Generates a JIRA HTML profile link from a userKey, using the specified UserFormats class.static void
optimizeBurndownChanges
(Map<String, List<BurndownChange>> changesPerIssue) Merge changes of equal timestamp into a single change objectstatic SortedMap
<Long, List<BurndownChange>> transformChangesToTimeline
(TimeZone userTimeZone, Map<String, List<BurndownChange>> changes) Transform the changes in the form of issueKey -> list of changes into a single timeline mixing all changes of all issuesstatic SortedMap
<Long, List<BurndownStateChange>> transformStateChangesToTimeline
(TimeZone userTimeZone, com.atlassian.jira.plugin.userformat.UserFormats userFormats, SortedSet<AuditEntry> entries, GHJSONMarshaller ghjsonMarshaller) Transforms the sprint state change audit log into a burndown change timeline, which maps a timestamp to a list of changes.
-
Constructor Details
-
BurndownChangeUtil
public BurndownChangeUtil()
-
-
Method Details
-
optimizeBurndownChanges
Merge changes of equal timestamp into a single change object -
transformChangesToTimeline
public static SortedMap<Long,List<BurndownChange>> transformChangesToTimeline(TimeZone userTimeZone, Map<String, List<BurndownChange>> changes) Transform the changes in the form of issueKey -> list of changes into a single timeline mixing all changes of all issues -
addStatisticsValueChanges
public static void addStatisticsValueChanges(org.joda.time.DateTime sprintStart, org.joda.time.DateTime upperTimeRange, Map<String, List<StatisticHistoryEntry>> statisticsValueHistory, Map<String, List<BurndownChange>> changesPerIssue) Adds statistics field value changes to the list of changes per issue -
transformStateChangesToTimeline
public static SortedMap<Long,List<BurndownStateChange>> transformStateChangesToTimeline(TimeZone userTimeZone, com.atlassian.jira.plugin.userformat.UserFormats userFormats, SortedSet<AuditEntry> entries, GHJSONMarshaller ghjsonMarshaller) Transforms the sprint state change audit log into a burndown change timeline, which maps a timestamp to a list of changes. This is achieved by looping over the audit entry logs and for each entry we extract a locale specific timestamp to use as the key for a list of BurndownStateChanges. In doing so, we collapse any changes that occurred simultaneously into the same list.- Parameters:
userTimeZone
- the timezone to transform changes relative to.userFormats
- a user formatter for generating HTML profile links for usernames.entries
- the list of sprint state audit entries.ghjsonMarshaller
- the json marshaller, for deserialising audit entry data.- Returns:
- the timeline, map sorted by its timestamp key, mapping each key list of burndown state changes.
-
getProfileLinkFromUserKey
public static String getProfileLinkFromUserKey(com.atlassian.jira.plugin.userformat.UserFormats userFormats, String userKey) Generates a JIRA HTML profile link from a userKey, using the specified UserFormats class.- Parameters:
userFormats
- a user formatter for generating HTML profile links for usernames.userKey
- the user key- Returns:
- html string for the user's profile link.
-
addColumnChanges
public static void addColumnChanges(org.joda.time.DateTime startDate, @Nullable org.joda.time.DateTime endDate, SortedMap<Long, Map<String, IssueColumnChangeEntry>> columnChanges, Map<String, List<BurndownChange>> changesPerIssue, boolean trimIntraColumnMoves) Adds column changes to the list of changes per issue -
addSprintHistoryChanges
public static void addSprintHistoryChanges(org.joda.time.DateTime sprintStart, org.joda.time.DateTime upperTimeRange, Map<String, List<SprintHistoryEntry>> sprintHistory, Map<String, List<BurndownChange>> changesPerIssue) Adds sprint history changes to the list of burndown changes per issue -
filterSprintHistoryEntriesBeforeSprintActivated
public static Map<String,List<SprintHistoryEntry>> filterSprintHistoryEntriesBeforeSprintActivated(Sprint sprint, Map<String, List<SprintHistoryEntry>> sprintHistoryMap) Given a sprint and a map of issue to list of sprint history entries, this function will remove any sprint history entries for an issue where it is added and then removed from the sprint before the sprint has been activated. Thus, if the list of sprint history entries looks like this:
added timeA, removed timeB, added timeC, (sprint activation), removed timeD
The resulting list of entries will look like this:
added timeC, (sprint activation), removed timeD
It is implicit that the list of
SprintHistoryEntry
objects per issue are only relating to a single sprint (the sprint specified as the parameter).- Parameters:
sprint
- the sprint that we are concerned withsprintHistoryMap
- the mapping from issue key to list of entries- Returns:
- a copy of the input map, with the redundant entries removed from each issue's list.
-
addTimeTrackingChanges
public static void addTimeTrackingChanges(org.joda.time.DateTime sprintStart, org.joda.time.DateTime upperTimeRange, Map<String, List<TimeTrackingHistoryService.HistoryEntry>> timeTrackingHistory, Map<String, List<BurndownChange>> changesPerIssue) -
addEpicHistoryChanges
public static void addEpicHistoryChanges(Map<String, List<EpicLinkHistoryEntry>> epicHistory, HashMap<String, List<BurndownChange>> changes) -
addVersionHistoryChanges
public static void addVersionHistoryChanges(Map<String, List<FixVersionChangeEntry>> history, HashMap<String, List<BurndownChange>> changes)
-