public class

DefaultUserIssueHistoryManager

extends Object
implements UserIssueHistoryManager
java.lang.Object
   ↳ com.atlassian.jira.user.DefaultUserIssueHistoryManager

Class Overview

A convenience wrapper around the UserHistoryManager to work directly with issues and perform permission checks

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.user.UserIssueHistoryManager
Public Constructors
DefaultUserIssueHistoryManager(UserHistoryManager userHistoryManager, PermissionManager permissionManager, IssueManager issueManager, ApplicationProperties applicationProperties)
Public Methods
void addIssueToHistory(ApplicationUser user, Issue issue)
Add an Issue to the user history list.
@Nonnull List<UserHistoryItem> getFullIssueHistoryWithPermissionChecks(ApplicationUser user)
Retrieve the user's issue history queue.
@Nonnull List<UserHistoryItem> getFullIssueHistoryWithoutPermissionChecks(ApplicationUser user)
Retrieve the user's issue history queue.
@Nonnull List<Issue> getShortIssueHistory(ApplicationUser user)
Retrieve the first X (jira.max.issue.history.dropdown.items) Issues from the user's issue history queue.
boolean hasIssueHistory(ApplicationUser user)
Determines whether the user has a current issue history.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.user.UserIssueHistoryManager

Public Constructors

public DefaultUserIssueHistoryManager (UserHistoryManager userHistoryManager, PermissionManager permissionManager, IssueManager issueManager, ApplicationProperties applicationProperties)

Public Methods

public void addIssueToHistory (ApplicationUser user, Issue issue)

Add an Issue to the user history list. A null users history should still be stored, even if only for duration of session

Parameters
user The user to add the history item to
issue The issue to add to the history list

@Nonnull public List<UserHistoryItem> getFullIssueHistoryWithPermissionChecks (ApplicationUser user)

Retrieve the user's issue history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.

Parameters
user The user to get the history issue items for.
Returns
  • a list of history issue items sort by desc lastViewed date.

@Nonnull public List<UserHistoryItem> getFullIssueHistoryWithoutPermissionChecks (ApplicationUser user)

Retrieve the user's issue history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs no permission checks.

Parameters
user The user to get the history issue items for.
Returns
  • a list of history issue items sort by desc lastViewed date.

@Nonnull public List<Issue> getShortIssueHistory (ApplicationUser user)

Retrieve the first X (jira.max.issue.history.dropdown.items) Issues from the user's issue history queue. This purpose of this method is to return a small list for easy display. The filtering could be done in the view code, but for performance reasons, is done here. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.

Parameters
user The user to get the history issue items for.
Returns
  • a list of issue items sorted by desc lastViewed date.

public boolean hasIssueHistory (ApplicationUser user)

Determines whether the user has a current issue history. This method also performs permission checks against issue to ensure that user can see at least 1 issue.

Parameters
user The user to check for.
Returns
  • true if the user has at least 1 issue in their issue history queue that they can see, false otherwise