com.atlassian.jira.issue.changehistory
Interface ChangeHistoryManager

All Known Implementing Classes:
DefaultChangeHistoryManager

@PublicApi
public interface ChangeHistoryManager

Manages the change history of issues. TODO: expand this interface to include the functionality from ChangeLogUtils


Method Summary
 Map<String,String> findAllPossibleValues(String field)
          Deprecated. since 5.2 - and will be removed in 6.0, it sucks performance wise and can kill a JIRA instance if you really need to find all values then use JiraLuceneFieldFinder
 Issue findMovedIssue(String originalKey)
          Returns an issue that has been moved by searching the change history of the original issue key for an updated issue key.
 Collection<Issue> findUserHistory(com.atlassian.crowd.embedded.api.User remoteUser, Collection<String> usernames, 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(com.atlassian.crowd.embedded.api.User remoteUser, Collection<String> usernames, 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, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns a List of ChangeHistory entities for a single issue.
 List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns a List of ChangeHistory entities for multiple issues.
 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.
 Collection<String> getPreviousIssueKeys(Long issueId)
          Returns the same as 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.
 

Method Detail

getChangeHistories

List<ChangeHistory> getChangeHistories(Issue issue)
Returns a List of ChangeHistory entities

Parameters:
issue - the issue.
Returns:
a List of ChangeHistory entries.

getChangeHistoriesForUser

List<ChangeHistory> getChangeHistoriesForUser(Issue issue,
                                              com.atlassian.crowd.embedded.api.User remoteUser)
Returns a List of ChangeHistory entities for a single issue.

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

List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues,
                                              com.atlassian.crowd.embedded.api.User remoteUser)
Returns 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 prefered whenever possible.

Parameters:
issues - the issues.
remoteUser - the user who is asking.
Returns:
a List of ChangeHistory entries.
Since:
5.1

getChangeItemsForField

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. Link, Fix Version/s, etc). The order of the list will from oldest to newest.

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.

getAllChangeItems

List<ChangeHistoryItem> getAllChangeItems(Issue issue)
Returns a List of ChangeHistoryItem's for the given issue

Parameters:
issue - the issue
Returns:
A list containing all of the change items for a specific Issue

findMovedIssue

Issue findMovedIssue(String originalKey)
                     throws org.ofbiz.core.entity.GenericEntityException
Returns an issue that has been moved by searching the change history of the original issue key for an updated issue key.

Parameters:
originalKey - the original key of an issue that has since been moved (moving between projects assigns a new key to an issue)
Returns:
the moved Issue object
Throws:
org.ofbiz.core.entity.GenericEntityException - if an unexpected error occurs

getPreviousIssueKeys

Collection<String> getPreviousIssueKeys(String issueKey)
Given an issue key, this method returns a list of previous issue keys this issue was moved from. This may be useful for source control plugins for example, where a given changeset should be displayed even after an issue has been moved and it's issue key has changed.

The list of previous issue keys is returned in chronological order, with the most recent issue key first.

Parameters:
issueKey - The current issue key.
Returns:
A collection of previous issue keys or an empty list if none exist.

getPreviousIssueKeys

Collection<String> getPreviousIssueKeys(Long issueId)
Returns the same as 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.

Parameters:
issueId - The id of the issue being looked up.
Returns:
A collection of previous issue keys or an empty list if none exist.

findUserHistory

Collection<Issue> findUserHistory(com.atlassian.crowd.embedded.api.User remoteUser,
                                  Collection<String> usernames,
                                  int maxResults)
Find a list of issues that the given users have acted on.

Parameters:
remoteUser - The user executing this request.
usernames - The 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
Since:
v4.0

findUserHistory

Collection<Issue> findUserHistory(com.atlassian.crowd.embedded.api.User remoteUser,
                                  Collection<String> usernames,
                                  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.

Parameters:
remoteUser - The user executing this request.
usernames - The 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 from
maxResults - The maxmimum number of issues to return
Returns:
An immutable collection of issue objects sorted by creation date in descending order
Since:
v4.3

findAllPossibleValues

Map<String,String> findAllPossibleValues(String field)
Deprecated. since 5.2 - and will be removed in 6.0, it sucks performance wise and can kill a JIRA instance if you really need to find all values then use JiraLuceneFieldFinder

Find a map of all names ever used in the change history.

Parameters:
field - The field name.
Returns:
An immutable map of issue objects sorted by creation date in descending order
Since:
v4.3

removeAllChangeItems

void removeAllChangeItems(Issue issue)
Remove all change items associated with an issue.

Parameters:
issue - affected issue


Copyright © 2002-2013 Atlassian. All Rights Reserved.