public class DefaultChangeHistoryManager extends Object implements ChangeHistoryManager
Modifier and Type | Field and Description |
---|---|
static String |
HISTORY_METADATA_KEY |
Constructor and Description |
---|
DefaultChangeHistoryManager(IssueManager issueManager,
OfBizDelegator ofBizDelegator,
PermissionManager permissionManager,
ComponentLocator componentLocator,
UserManager userManager,
JsonEntityPropertyManager jsonEntityPropertyManager) |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
findAllPossibleValues(String field)
Deprecated.
|
Issue |
findMovedIssue(String originalKey)
Returns an issue that has been moved by searching on the old issue key.
|
Collection<Issue> |
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.
|
Collection<Issue> |
findUserHistory(ApplicationUser remoteUser,
Collection<String> userkeys,
int maxResults)
Find a list of issues that the given users have acted on.
|
List<ChangeHistoryItem> |
getAllChangeItems(Issue issue)
Returns a List of
ChangeHistoryItem 's for the given issue |
List<ChangeHistory> |
getChangeHistories(Issue issue)
Returns a List of ChangeHistory entities
|
List<ChangeHistory> |
getChangeHistoriesForUser(Issue issue,
ApplicationUser remoteUser)
Returns a List of ChangeHistory entities for a single issue.
|
List<ChangeHistory> |
getChangeHistoriesForUser(Iterable<Issue> issues,
ApplicationUser remoteUser)
Returns a List of ChangeHistory entities for multiple issues.
|
List<ChangeHistory> |
getChangeHistoriesForUser(Iterable<Issue> issues,
ApplicationUser remoteUser,
Integer limit)
Returns a List of ChangeHistory entities for multiple issues.
|
List<ChangeHistory> |
getChangeHistoriesSince(Issue issue,
Date since)
Returns a List of ChangeHistory entities that occurred after the provided date.
|
ChangeHistory |
getChangeHistoryById(Long changeGroupId) |
List<ChangeItemBean> |
getChangeItemsForField(Issue issue,
String changeItemFieldName)
Returns a List of ChangeItemBean's for the given issue which also are for the provided changeItemFieldName (i.e.
|
List<ChangeHistory> |
getChangeItemsWithFieldsForIssues(Iterable<Issue> issues,
Iterable<String> fieldNames)
Returns a List of ChangeHistory for the listed issues with changes only for the listed fields.
|
Collection<String> |
getPreviousIssueKeys(Long issueId)
Returns the same as
ChangeHistoryManager.getPreviousIssueKeys(String) but is slightly more efficient since no lookup of the
issue id needs to be performed. |
Collection<String> |
getPreviousIssueKeys(String issueKey)
Given an issue key, this method returns a list of previous issue keys this issue was moved from.
|
void |
removeAllChangeItems(Issue issue)
Remove all change items associated with an issue.
|
public static final String HISTORY_METADATA_KEY
public DefaultChangeHistoryManager(IssueManager issueManager, OfBizDelegator ofBizDelegator, PermissionManager permissionManager, ComponentLocator componentLocator, UserManager userManager, JsonEntityPropertyManager jsonEntityPropertyManager)
@Nullable public ChangeHistory getChangeHistoryById(Long changeGroupId)
getChangeHistoryById
in interface ChangeHistoryManager
public List<ChangeHistory> getChangeHistories(Issue issue)
ChangeHistoryManager
getChangeHistories
in interface ChangeHistoryManager
issue
- the issue.@Nonnull public List<ChangeHistory> getChangeHistoriesSince(@Nonnull Issue issue, @Nonnull Date since)
ChangeHistoryManager
getChangeHistoriesSince
in interface ChangeHistoryManager
issue
- the issue. Must not be null.since
- only change histories made after this date will be returned. Must not be null.public List<ChangeHistory> getChangeHistoriesForUser(Issue issue, ApplicationUser remoteUser)
ChangeHistoryManager
getChangeHistoriesForUser
in interface ChangeHistoryManager
issue
- the issue.remoteUser
- the user who is asking.for a more
efficient way to read change histories for multiple issues
public List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser)
ChangeHistoryManager
#getChangeHistoriesForUser(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User)
and should be
preferred whenever possible.getChangeHistoriesForUser
in interface ChangeHistoryManager
issues
- the issues.remoteUser
- the user who is asking.public List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser, Integer limit)
ChangeHistoryManager
#getChangeHistoriesForUser(com.atlassian.jira.issue.Issue, com.atlassian.crowd.embedded.api.User)
and should be
preferred whenever possible. ReturnsgetChangeHistoriesForUser
in interface ChangeHistoryManager
issues
- the issues.remoteUser
- the user who is asking.limit
- maximum amount of records to returnpublic List<ChangeHistory> getChangeItemsWithFieldsForIssues(Iterable<Issue> issues, Iterable<String> fieldNames)
ChangeHistoryManager
getChangeItemsWithFieldsForIssues
in interface ChangeHistoryManager
issues
- The list of issues to searchfieldNames
- The list of field namespublic List<ChangeItemBean> getChangeItemsForField(Issue issue, String changeItemFieldName)
ChangeHistoryManager
getChangeItemsForField
in interface ChangeHistoryManager
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.public List<ChangeHistoryItem> getAllChangeItems(Issue issue)
ChangeHistoryManager
ChangeHistoryItem
's for the given issuegetAllChangeItems
in interface ChangeHistoryManager
issue
- the issuepublic Issue findMovedIssue(String originalKey)
ChangeHistoryManager
findMovedIssue
in interface ChangeHistoryManager
originalKey
- the original key of an issue that has since been moved (moving between projects assigns a new
key to an issue)Issue
objectpublic Collection<String> getPreviousIssueKeys(Long issueId)
ChangeHistoryManager
ChangeHistoryManager.getPreviousIssueKeys(String)
but is slightly more efficient since no lookup of the
issue id needs to be performed. If you have an issue object available with the issue's id use this method.getPreviousIssueKeys
in interface ChangeHistoryManager
issueId
- The id of the issue being looked up.public Collection<String> getPreviousIssueKeys(String issueKey)
ChangeHistoryManager
Note: The list of previous issue keys is no longer returned in chronological order.
getPreviousIssueKeys
in interface ChangeHistoryManager
issueKey
- The current issue key.public Collection<Issue> findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, int maxResults)
ChangeHistoryManager
findUserHistory
in interface ChangeHistoryManager
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 returnpublic Collection<Issue> findUserHistory(ApplicationUser remoteUser, Collection<String> userkeys, Collection<Project> projects, int maxResults)
ChangeHistoryManager
findUserHistory
in interface ChangeHistoryManager
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@Deprecated public Map<String,String> findAllPossibleValues(String field)
ChangeHistoryManager
findAllPossibleValues
in interface ChangeHistoryManager
field
- The field name.public void removeAllChangeItems(Issue issue)
ChangeHistoryManager
removeAllChangeItems
in interface ChangeHistoryManager
issue
- affected issueCopyright © 2002-2022 Atlassian. All Rights Reserved.