Class LastVisitedItemInProjectService

java.lang.Object
com.atlassian.jira.projects.sidebar.lastvisited.LastVisitedItemInProjectService

@Component public class LastVisitedItemInProjectService extends Object
Responsible for getting and setting the last visited item in the sidebar. When setting the last visited item, it checks whether the item about to be saved is an item that actually exists in the sidbear. When getting the URL of the last visited item, it checks if the item we're retrieving is still present in the sidebar (as the plugin providing that web-item could have been disabled), and returns the URL if it is.
  • Constructor Details

  • Method Details

    • setLastVisitedItemIdForProject

      public Optional<ErrorCollection> setLastVisitedItemIdForProject(Project project, String lastVisitedItemId)
      Set the last visited item ID for a particular project. If the provided ID is not valid, it is not saved.
      Parameters:
      project - The project that we are saving the last visited item for
      lastVisitedItemId - The fully qualified id of the last visited item (for example, com.atlassian.jira.jira-projects-plugin:report-page)
      Returns:
      An Optional over ErrorCollection, indicating whether or not errors were encountered in saving the last visited item
    • getLastVisitedItemUrl

      public Optional<String> getLastVisitedItemUrl(Project project)
      Get the URL of the last visited item for a project.
      Parameters:
      project - The project to get the last visited item for
      Returns:
      An Optional over String, containing the URL