Class DefaultChangeHistoryManager
java.lang.Object
com.atlassian.jira.issue.changehistory.DefaultChangeHistoryManager
- All Implemented Interfaces:
ChangeHistoryManager
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultChangeHistoryManager(IssueManager issueManager, OfBizDelegator ofBizDelegator, PermissionManager permissionManager, ComponentLocator componentLocator, UserManager userManager, JsonEntityPropertyManager jsonEntityPropertyManager) -
Method Summary
Modifier and TypeMethodDescriptionfindUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, int maxResults) Find a list of issues that the given users have acted on.findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, Collection<Project> projects, int maxResults) Find a list of issues that the given users have acted on with the option to limit the projects included in the search.findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, Collection<Project> projects, int maxResults, Date oldestUpdateTime) Find a list of issues that the given users have acted on with the option to limit the projects included in the search.getAllChangeItems(Issue issue) Returns a List ofChangeHistoryItem's for the given issue.getChangeHistories(Issue issue) Returns a List of ChangeHistory entitiesgetChangeHistoriesForUser(Issue issue, ApplicationUser remoteUser) Returns a List of ChangeHistory entities for a single issue.getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser) Returns a List of ChangeHistory entities for multiple issues.getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser, Integer limit) Returns a List of ChangeHistory entities for multiple issues.getChangeHistoriesSince(Issue issue, Date since) Returns a List of ChangeHistory entities that occurred after the provided date.getChangeHistoryById(Long changeGroupId) getChangeItemsForField(Issue issue, String changeItemFieldName) Returns a list of ChangeItemBean for the given issue which also are for the provided changeItemFieldName (i.e.getChangeItemsForField(Issue issue, String changeItemFieldName, Date since) Returns a list of ChangeItemBean for the given issue which also are for the provided changeItemFieldName (i.e.getChangeItemsWithFieldsForIssues(Iterable<Issue> issues, Iterable<String> fieldNames) Returns a List of ChangeHistory for the listed issues with changes only for the listed fields.getPreviousIssueKeys(Long issueId) voidremoveAllChangeItems(Issue issue) Remove all change items associated with an issue.
-
Field Details
-
HISTORY_METADATA_KEY
- See Also:
-
-
Constructor Details
-
DefaultChangeHistoryManager
public DefaultChangeHistoryManager(IssueManager issueManager, OfBizDelegator ofBizDelegator, PermissionManager permissionManager, ComponentLocator componentLocator, UserManager userManager, JsonEntityPropertyManager jsonEntityPropertyManager)
-
-
Method Details
-
getChangeHistoryById
- Specified by:
getChangeHistoryByIdin interfaceChangeHistoryManager- Returns:
- a ChangeHistory group with the given id, or null if not found
-
getChangeHistories
Description copied from interface:ChangeHistoryManagerReturns a List of ChangeHistory entities- Specified by:
getChangeHistoriesin interfaceChangeHistoryManager- Parameters:
issue- the issue.- Returns:
- a List of ChangeHistory entries.
-
getChangeHistoriesSince
@Nonnull public List<ChangeHistory> getChangeHistoriesSince(@Nonnull Issue issue, @Nonnull Date since) Description copied from interface:ChangeHistoryManagerReturns a List of ChangeHistory entities that occurred after the provided date.- Specified by:
getChangeHistoriesSincein interfaceChangeHistoryManager- Parameters:
issue- the issue. Must not be null.since- only change histories made after this date will be returned. Must not be null.- Returns:
- a possibly empty List of ChangeHistory entries made after the provided date. Will not be null.
-
getChangeHistoriesForUser
Description copied from interface:ChangeHistoryManagerReturns a List of ChangeHistory entities for a single issue.- Specified by:
getChangeHistoriesForUserin interfaceChangeHistoryManager- Parameters:
issue- the issue.remoteUser- the user who is asking.- Returns:
- a List of ChangeHistory entries.
- See Also:
-
for a more efficient way to read change histories for multiple issues
-
getChangeHistoriesForUser
public List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser) Description copied from interface:ChangeHistoryManagerReturns a List of ChangeHistory entities for multiple issues. This method is much more efficient than#getChangeHistoriesForUser(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User)and should be preferred whenever possible.- Specified by:
getChangeHistoriesForUserin interfaceChangeHistoryManager- Parameters:
issues- the issues.remoteUser- the user who is asking.- Returns:
- a List of ChangeHistory entries.
-
getChangeHistoriesForUser
public List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser, Integer limit) Description copied from interface:ChangeHistoryManagerReturns a List of ChangeHistory entities for multiple issues. This method is much more efficient than#getChangeHistoriesForUser(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User)and should be preferred whenever possible. Returns- Specified by:
getChangeHistoriesForUserin interfaceChangeHistoryManager- Parameters:
issues- the issues.remoteUser- the user who is asking.limit- maximum amount of records to return- Returns:
- a List of ChangeHistory entries in Ascending order by date and id
-
getChangeItemsWithFieldsForIssues
public List<ChangeHistory> getChangeItemsWithFieldsForIssues(Iterable<Issue> issues, Iterable<String> fieldNames) Description copied from interface:ChangeHistoryManagerReturns a List of ChangeHistory for the listed issues with changes only for the listed fields.- Specified by:
getChangeItemsWithFieldsForIssuesin interfaceChangeHistoryManager- Parameters:
issues- The list of issues to searchfieldNames- The list of field names- Returns:
- A list of changes.
-
getChangeItemsForField
Description copied from interface:ChangeHistoryManagerReturns a list of ChangeItemBean for the given issue which also are for the provided changeItemFieldName (i.e. Link, Fix Version/s, etc). The order of the list will from oldest to newest.- Specified by:
getChangeItemsForFieldin interfaceChangeHistoryManager- Parameters:
issue- the issue the change items are associated with, not null.changeItemFieldName- the field name the change item is stored under, not null or empty.- Returns:
- a List of ChangeItemBean's for the given issue.
-
getChangeItemsForField
@Nonnull public List<ChangeItemBean> getChangeItemsForField(@Nonnull Issue issue, String changeItemFieldName, @Nonnull Date since) Description copied from interface:ChangeHistoryManagerReturns a list of ChangeItemBean for the given issue which also are for the provided changeItemFieldName (i.e. Link, Fix Version/s, etc) and the provided date since the changes have been created. The order of the list returned is from oldest to newest.- Specified by:
getChangeItemsForFieldin interfaceChangeHistoryManager- Parameters:
issue- the issue the change items are associated with, not null.changeItemFieldName- the field name the change item is stored under, not null or empty.since- only change items created after this date will be returned, not null.- Returns:
- a List of ChangeItemBean's for the given issue.
-
getAllChangeItems
Description copied from interface:ChangeHistoryManagerReturns a List ofChangeHistoryItem's for the given issue. Items in the returned list are ordered ascending by creation date any id.- Specified by:
getAllChangeItemsin interfaceChangeHistoryManager- Parameters:
issue- the issue- Returns:
- A list containing all of the change items for a specific Issue
-
getPreviousIssueKeys
-
findUserHistory
public Collection<Issue> findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, int maxResults) Description copied from interface:ChangeHistoryManagerFind a list of issues that the given users have acted on.- Specified by:
findUserHistoryin interfaceChangeHistoryManager- Parameters:
remoteUser- The user executing this request.userkeys- The keys of users to find the history for. If null, returns the history for all users. If empty, no results will be found.maxResults- The maxmimum number of issues to return- Returns:
- An immutable collection of issue objects sorted by creation date in descending order
-
findUserHistory
public Collection<Issue> findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, Collection<Project> projects, int maxResults) Description copied from interface:ChangeHistoryManagerFind a list of issues that the given users have acted on with the option to limit the projects included in the search.- Specified by:
findUserHistoryin interfaceChangeHistoryManager- Parameters:
remoteUser- The user executing this request.userkeys- The keys of users to find the history for. If null, returns the history for all users. If empty, no results will be found.projects- The projects to include issues frommaxResults- The maxmimum number of issues to return- Returns:
- An immutable collection of issue objects sorted by creation date in descending order
-
findUserHistory
public Collection<Issue> findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, Collection<Project> projects, int maxResults, Date oldestUpdateTime) Description copied from interface:ChangeHistoryManagerFind a list of issues that the given users have acted on with the option to limit the projects included in the search.- Specified by:
findUserHistoryin interfaceChangeHistoryManager- Parameters:
remoteUser- The user executing this request.userkeys- The keys of users to find the history for. If null, returns the history for all users. If empty, no results will be found.projects- The projects to include issues frommaxResults- The maxmimum number of issues to returnoldestUpdateTime- issues updated prior to this time will not be included in the result- Returns:
- An immutable collection of issue objects sorted by creation date in descending order
-
removeAllChangeItems
Description copied from interface:ChangeHistoryManagerRemove all change items associated with an issue.- Specified by:
removeAllChangeItemsin interfaceChangeHistoryManager- Parameters:
issue- affected issue
-