Class DefaultWorklogService

java.lang.Object
com.atlassian.jira.bc.issue.worklog.DefaultWorklogService
All Implemented Interfaces:
WorklogService

public class DefaultWorklogService extends Object implements WorklogService
Default implementation of the WorklogService.
  • Constructor Details

  • Method Details

    • validateDelete

      public WorklogResult validateDelete(JiraServiceContext jiraServiceContext, Long worklogId)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permissions as determined by calling WorklogService.hasPermissionToDelete(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.worklog.Worklog) to delete a worklog for this issue.
      Specified by:
      validateDelete in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      worklogId - identifies the worklog that the update validation will occur against
      Returns:
      WorklogResult which can be passed to the delete methods if has permission and the data passed in is valid, null otherwise
    • validateDeleteWithNewEstimate

      public WorklogNewEstimateResult validateDeleteWithNewEstimate(JiraServiceContext jiraServiceContext, Long worklogId, String newEstimate)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permissions as determined by calling WorklogService.hasPermissionToDelete(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.worklog.Worklog) to delete a worklog for this issue.
      Specified by:
      validateDeleteWithNewEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      worklogId - identifies the worklog that the delete validation will occur against
      newEstimate - The value to change the issues remaining estimate to.
      Returns:
      Worklog which can be passed to the delete methods if has permission and the data passed in is valid, null otherwise
    • validateDeleteWithManuallyAdjustedEstimate

      public WorklogAdjustmentAmountResult validateDeleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, Long worklogId, String adjustmentAmount)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permissions as determined by calling WorklogService.hasPermissionToDelete(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.worklog.Worklog) to delete a worklog for this issue.
      Specified by:
      validateDeleteWithManuallyAdjustedEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      worklogId - identifies the worklog that the delete validation will occur against
      adjustmentAmount - The value to increase the issues remaining estimate by.
      Returns:
      Worklog which can be passed to the delete methods if has permission and the data passed in is valid, null otherwise
    • deleteWithNewRemainingEstimate

      public boolean deleteWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogNewEstimateResult worklogNewEstimate, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Deletes the specified Worklog. This method will adjust the issues remaining estimate to be the new value which has been passed to this method, the old remaining estimate value will be lost.
      Specified by:
      deleteWithNewRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to update the supplied worklog and the ErrorCollection that will contain any errors encountered in calling the method
      worklogNewEstimate - the Worklog and new estimate for the issue.
      dispatchEvent - whether or not you want to have an event dispatched on Worklog delete @return the deleted Worklog object, or null if no object has been deleted.
      Returns:
      true if the Worklog was successfully deleted, false otherwise
    • deleteWithManuallyAdjustedEstimate

      public boolean deleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogAdjustmentAmountResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Deletes the specified Worklog. This method will adjust the issues remaining estimate to be the new value which has been passed to this method, the old remaining estimate value will be lost.
      Specified by:
      deleteWithManuallyAdjustedEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to update the supplied worklog and the ErrorCollection that will contain any errors encountered in calling the method
      worklogResult - the Worklog and adjustmentAmount for the issue.
      dispatchEvent - whether or not you want to have an event dispatched on Worklog delete @return the deleted Worklog object, or null if no object has been deleted.
      Returns:
      true if the Worklog was successfully deleted, false otherwise
    • deleteAndRetainRemainingEstimate

      public boolean deleteAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Deletes the specified Worklog. This method will make no adjustment to the issues remaining estimate.
      Specified by:
      deleteAndRetainRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to update the supplied worklog and the ErrorCollection that will contain any errors encountered in calling the method
      worklogResult - result of the call to WorklogService.validateDelete(com.atlassian.jira.bc.JiraServiceContext, Long) which contains the Worklog to delete
      dispatchEvent - whether or not you want to have an event dispatched on Worklog delete
      Returns:
      true if the Worklog was successfully deleted, false otherwise
    • deleteAndAutoAdjustRemainingEstimate

      public boolean deleteAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Deletes the specified Worklog. This method will auto-adjust the issues remaining estimate by adding the time spent on the deleted worklog.
      Specified by:
      deleteAndAutoAdjustRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to update the supplied worklog and the ErrorCollection that will contain any errors encountered in calling the method
      worklogResult - result of the call to WorklogService.validateDelete(com.atlassian.jira.bc.JiraServiceContext, Long) which contains the Worklog to delete
      dispatchEvent - whether or not you want to have an event dispatched on Worklog delete
      Returns:
      true if the Worklog was successfully deleted, false otherwise
    • validateUpdate

      public WorklogResult validateUpdate(JiraServiceContext jiraServiceContext, WorklogInputParameters params)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permissions as determined by calling WorklogService.hasPermissionToUpdate(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.worklog.Worklog) to update a worklog for this issue.
      Specified by:
      validateUpdate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      params - parameter object that contains all the values required to validate
      Returns:
      WorklogResult which can be passed to the update methods if has permission and the data passed in is valid, null otherwise
    • validateUpdateWithNewEstimate

      public WorklogNewEstimateResult validateUpdateWithNewEstimate(JiraServiceContext jiraServiceContext, WorklogNewEstimateInputParameters params)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permissions as determined by calling WorklogService.hasPermissionToUpdate(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.worklog.Worklog) to update a worklog for this issue.
      Specified by:
      validateUpdateWithNewEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      params - parameter object that contains all the values required to validate
      Returns:
      WorklogResult which can be passed to the update methods if has permission and the data passed in is valid, null otherwise
    • updateWithNewRemainingEstimate

      public Worklog updateWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogNewEstimateResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Updates the provided Worklog. This method will adjust the issues remaining estimate to be the new value which has been passed to this method, the old remaining estimate value will be lost.
      Specified by:
      updateWithNewRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      worklogResult - the Worklog and new estimate for the issue.
      dispatchEvent - whether or not you want to have an event dispatched on Worklog update @return the updated Worklog object, or null if no object has been updated.
      Returns:
      the updated Worklog object, or null if no object has been updated.
    • updateAndRetainRemainingEstimate

      public Worklog updateAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Updates the provided Worklog. This method will make no adjustment to the issues remaining estimate.
      Specified by:
      updateAndRetainRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to update the supplied worklog and the ErrorCollection that will contain any errors encountered in calling the method
      worklogResult - result of the call to WorklogService.validateUpdate(com.atlassian.jira.bc.JiraServiceContext, WorklogInputParameters) which contains the Worklog to update
      dispatchEvent - whether or not you want to have an event dispatched on Worklog update
      Returns:
      the updated Worklog object, or null if no object has been updated.
    • updateAndAutoAdjustRemainingEstimate

      public Worklog updateAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Updates the provided Worklog. This method will auto-adjust the issues remaining estimate based on the updated value of the time spent on the work.
      Specified by:
      updateAndAutoAdjustRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to update the worklog and the ErrorCollection that will contain any errors in calling the method
      worklogResult - result of the call to WorklogService.validateUpdate(com.atlassian.jira.bc.JiraServiceContext, WorklogInputParameters) which contains the Worklog to update
      dispatchEvent - whether or not you want to have an event dispatched on Worklog update
      Returns:
      the update Worklog object, or null if no object has been updated.
    • delete

      protected boolean delete(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, Long newEstimate, boolean dispatchEvent)
    • update

      protected Worklog update(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, Long newEstimate, boolean dispatchEvent)
    • validateCreate

      public WorklogResult validateCreate(JiraServiceContext jiraServiceContext, WorklogInputParameters params)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permissions as determined by calling WorklogService.hasPermissionToCreate(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.Issue, boolean) to create a worklog for this issue.
      Specified by:
      validateCreate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      params - parameter object that contains all the values required to validate
      Returns:
      WorklogResult which can be passed to the create methods if has permission and the data passed in is valid, null otherwise
    • validateCreateWithNewEstimate

      public WorklogNewEstimateResult validateCreateWithNewEstimate(JiraServiceContext jiraServiceContext, WorklogNewEstimateInputParameters params)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permission as determined by calling WorklogService.hasPermissionToCreate(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.Issue, boolean) to create a worklog for this issue.
      Specified by:
      validateCreateWithNewEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      params - parameter object that contains all the values required to validate
      Returns:
      WorklogNewEstimateResult the Worklog of which can be passed to the create methods if has permission and the data passed in is valid, null otherwise
    • validateCreateWithManuallyAdjustedEstimate

      public WorklogAdjustmentAmountResult validateCreateWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogAdjustmentAmountInputParameters params)
      Description copied from interface: WorklogService
      Determines whether worklogs are enabled in JIRA and if the user has the required permission as determined by calling WorklogService.hasPermissionToCreate(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.Issue, boolean) to create a worklog for this issue.
      Specified by:
      validateCreateWithManuallyAdjustedEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the user who wishes to create a worklog and the errorCollection that will contain any errors in calling the method
      params - parameter object that contains all the values required to validate
      Returns:
      WorklogAdjustmentAmountResult the Worklog of which can be passed to the create methods if has permission and the data passed in is valid, null otherwise
    • createWithNewRemainingEstimate

      public Worklog createWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogNewEstimateResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Persists a new Worklog on the given Issue. This method will adjust the issues remaining estimate to be the new value which has been passed to this method, the old remaining estimate value will be lost.
      Specified by:
      createWithNewRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      worklogResult - the Worklog and new estimate for the issue.
      dispatchEvent - whether or not you want to have an event dispatched on Worklog creation
      Returns:
      the created Worklog object or null if no object was created.
      See Also:
    • createWithManuallyAdjustedEstimate

      public Worklog createWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogAdjustmentAmountResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Persists a new Worklog on the given Issue. This method will adjust the issues remaining estimate by reducing by the adjustmentAmount which has been passed to this method. Before calling this method, you must call validateCreateWithManuallyAdjustedEstimate() to ensure that the creation is OK.
      Specified by:
      createWithManuallyAdjustedEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      worklogResult - the Worklog and adjustmentAmount for the issue.
      dispatchEvent - whether or not you want to have an event dispatched on Worklog creation
      Returns:
      the created Worklog object or null if no object was created.
      See Also:
    • createAndRetainRemainingEstimate

      public Worklog createAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Persists a new Worklog on the given Issue. This method will make no adjustment to the issues remaining estimate.
      Specified by:
      createAndRetainRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      worklogResult - the WorklogResult generated by the validate call
      dispatchEvent - whether or not you want to have an event dispatched on Worklog creation @return the created Worklog object, or null if no object created.
      Returns:
      the created Worklog object or null if no object was created.
    • createAndAutoAdjustRemainingEstimate

      public Worklog createAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, boolean dispatchEvent)
      Description copied from interface: WorklogService
      Persists a new Worklog on the given Issue. This method will auto-adjust the issues remaining estimate based on the value of the time spent on the work.
      Specified by:
      createAndAutoAdjustRemainingEstimate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      worklogResult - the WorklogResult generated by the validate call
      dispatchEvent - whether or not you want to have an event dispatched on Worklog creation @return the created Worklog object, or null if no object created.
      Returns:
      the created Worklog object or null if no object was created.
    • hasPermissionToCreate

      public boolean hasPermissionToCreate(JiraServiceContext jiraServiceContext, Issue issue, boolean isEditableCheckRequired)
      Description copied from interface: WorklogService
      Determines if the user has the Permissions.WORK_ISSUE permission, that timetracking is enabled in JIRA and that the associated issue is in an editable workflow state.
      Specified by:
      hasPermissionToCreate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      issue - the issue to add the worklog to
      isEditableCheckRequired - set to true if we require the issue to be in an editable state. This should always be the case except when logging work on transition
      Returns:
      true if the user has permission to create a worklog on the specified issue, false otherwise
    • hasPermissionToUpdate

      public boolean hasPermissionToUpdate(JiraServiceContext jiraServiceContext, Worklog worklog)
      Description copied from interface: WorklogService
      Determine whether the current user has the permission to update the supplied worklog, timetracking is enabled in JIRA and that the associated issue is in an editable workflow state.

      In case of errors, add error messages to the error collection within the servicecontext.

      Passing in null worklog or a worklog with null ID will return false and an error message will be added to the error collection.

      Passing in null error collection will throw NPE.

      This method will return true if the user is a member of the worklog's group/role level (if specified) AND

      and false otherwise.
      Specified by:
      hasPermissionToUpdate in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to update the worklog and the ErrorCollection that will contain any errors in calling the method
      worklog - the Worklog the user wishes to update
      Returns:
      true if the user has permission to update the supplied worklog, false otherwise
    • hasPermissionToDelete

      public boolean hasPermissionToDelete(JiraServiceContext jiraServiceContext, Worklog worklog)
      Description copied from interface: WorklogService
      Determine whether the current user has the permission to delete the supplied worklog, timetracking is enabled in JIRA and that the associated issue is in an editable workflow state.

      In case of errors, add error messages to the error collection within the servicecontext.

      Passing in null worklog or a worklog with null ID will return false and an error message will be added to the error collection.

      Passing in null error collection will throw NPE.

      This method will return true if the user is a member of the worklog's group/role level (if specified) AND

      and false otherwise.
      Specified by:
      hasPermissionToDelete in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to delete the worklog and the ErrorCollection that will contain any errors in calling the method
      worklog - the Worklog the user wishes to delete
      Returns:
      true if the user has permission to delete the supplied worklog, false otherwise
    • getById

      public Worklog getById(JiraServiceContext jiraServiceContext, Long id)
      Description copied from interface: WorklogService
      Used to get a worklog by its id.
      Specified by:
      getById in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      id - uniquely identifies the worklog
      Returns:
      returns the worklog for the passed in id, null if not found.
    • getByIssue

      public List getByIssue(JiraServiceContext jiraServiceContext, Issue issue)
      Description copied from interface: WorklogService
      Returns all child worklogs of a specified issue.
      Specified by:
      getByIssue in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      issue - the specified parent issue (not null)
      Returns:
      a List of Worklogs, ordered by creation date. An empty List will be returned if none are found
    • getByIssueVisibleToUser

      public List<Worklog> getByIssueVisibleToUser(JiraServiceContext jiraServiceContext, Issue issue)
      Description copied from interface: WorklogService
      Returns all child worklogs of a specified issue that the provided user has permission to see.
      Specified by:
      getByIssueVisibleToUser in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      issue - the specified parent issue (not null)
      Returns:
      a List of Worklogs, ordered by creation date. An empty List will be returned if none are found
    • getByIssueVisibleToUser

      public Window<Worklog> getByIssueVisibleToUser(CommentSearchParameters parameters)
      Description copied from interface: WorklogService
      Returns child worklogs filtered according CommentSearchParameters to parameters. CommentSearchParameters are used because they are able to handle focused items.
      Specified by:
      getByIssueVisibleToUser in interface WorklogService
      Parameters:
      parameters - parameters for search (not null)
      Returns:
      a Window of Worklogs, ordered by start date. An empty Window will be returned if none are found
    • getByIssueVisibleToUser

      public PagedList<Worklog> getByIssueVisibleToUser(JiraServiceContext jiraServiceContext, Issue issue, int pageSize)
      Description copied from interface: WorklogService
      Returns a PagedList over all all child worklogs of a specified issue that the provided user has permission to see.
      Specified by:
      getByIssueVisibleToUser in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      issue - the specified parent issue (not null)
      pageSize - the number of worklogs per page
      Returns:
      a List of Worklogs, ordered by creation date. An empty List will be returned if none are found
    • isTimeTrackingEnabled

      public boolean isTimeTrackingEnabled()
      Description copied from interface: WorklogService
      Will return true if APKeys.JIRA_OPTION_TIMETRACKING is true, false otherwise.
      Specified by:
      isTimeTrackingEnabled in interface WorklogService
      Returns:
      true if enabled, false otherwise.
    • isIssueInEditableWorkflowState

      public boolean isIssueInEditableWorkflowState(Issue issue)
      Description copied from interface: WorklogService
      Will return true if the issue is in an editable workflow state.
      Specified by:
      isIssueInEditableWorkflowState in interface WorklogService
      Parameters:
      issue - the issue to see if it is in an editable store
      Returns:
      true if editable, false otherwise
    • getWorklogsUpdatedSince

      public WorklogChangedSincePage<Worklog> getWorklogsUpdatedSince(ApplicationUser user, Long sinceInMilliseconds)
      Description copied from interface: WorklogService
      Returns a list of worklogs visible by the calling user, which were modified since time provided in . The list is limited to WorklogManager.WORKLOG_UPDATE_DATA_PAGE_SIZE elements, in order to get more elements, execute this method again with which is equal to the updated time of the last element in the result. This won't return worklogs updated within last minute.
      Specified by:
      getWorklogsUpdatedSince in interface WorklogService
      Parameters:
      user - user retrieving the list of modified worklogs since a qiven time expressed in miliseconds.
      sinceInMilliseconds - the time (measured as a difference between the timestamp and midnight, January 1, 1970 UTC) since which the modified worklogs will be returned.
      Returns:
      a list of worklogs visible by the calling users, which were modified since the time provided in .
    • getWorklogsDeletedSince

      public WorklogChangedSincePage<DeletedWorklog> getWorklogsDeletedSince(ApplicationUser user, Long sinceInMilliseconds)
      Description copied from interface: WorklogService
      Returns a list of ids of worklogs which were removed, since the time provided in . The list is limited to WorklogManager.WORKLOG_UPDATE_DATA_PAGE_SIZE elements, in order to get more elements, execute this method again with which is equal to removal time of the last element in the result. This won't return worklogs updated within last minute.
      Specified by:
      getWorklogsDeletedSince in interface WorklogService
      Parameters:
      user - user retrieving the list of deleted worklogs since a qiven time expressed in milliseconds.
      sinceInMilliseconds - the time (measured as a difference between the timestamp and midnight, January 1, 1970 UTC) since which the deleted worklogs will be returned.
      Returns:
      a list of ids of deleted worklogs, which were removed since the time provided in .
    • getWorklogsForIds

      public ServiceOutcome<Set<Worklog>> getWorklogsForIds(JiraServiceContext jiraServiceContext, Set<Long> idsOfWorklogs)
      Description copied from interface: WorklogService
      Returns a set of worklogs for provided ids. If the calling user doesn't have permissions to get worklog for given id, the worklog won't be returned. The set is limited to WorklogManager.WORKLOG_UPDATE_DATA_PAGE_SIZE elements, in order to get more elements, execute this method again providing ids of other Worklog to retrieve.
      Specified by:
      getWorklogsForIds in interface WorklogService
      Parameters:
      jiraServiceContext - containing the User who wishes to create a worklog and the ErrorCollection that will contain any errors in calling the method
      idsOfWorklogs - set of ids for which worklogs will be returned.
      Returns:
      a set of worklogs for provided ids.
    • validateParamsAndCreateWorklog

      protected Worklog validateParamsAndCreateWorklog(JiraServiceContext jiraServiceContext, Issue issue, ApplicationUser author, Visibility visibility, String timeSpent, Date startDate, Long worklogId, String comment, Date created, Date updated, ApplicationUser updateAuthor, String errorFieldPrefix)
    • create

      protected Worklog create(JiraServiceContext jiraServiceContext, WorklogResult worklogResult, Long newEstimate, boolean dispatchEvent)
    • hasEditOwnPermission

      protected boolean hasEditOwnPermission(ApplicationUser user, Worklog worklog)
    • hasViewPermission

      protected boolean hasViewPermission(ApplicationUser user, Issue issue)
    • hasEditAllPermission

      protected boolean hasEditAllPermission(ApplicationUser user, Issue issue)
    • hasDeleteOwnPermission

      protected boolean hasDeleteOwnPermission(ApplicationUser user, Worklog worklog)
    • hasDeleteAllPermission

      protected boolean hasDeleteAllPermission(ApplicationUser user, Issue issue)
    • isSameAuthor

      protected boolean isSameAuthor(ApplicationUser user, Worklog worklog)
    • getAutoAdjustNewEstimateOnUpdate

      protected Long getAutoAdjustNewEstimateOnUpdate(Issue issue, Long newTimeSpent, Long originalTimeSpent)
    • reduceEstimate

      protected Long reduceEstimate(Issue issue, Long amount)
    • increaseEstimate

      protected Long increaseEstimate(Issue issue, Long amount)
    • isValidNewEstimate

      protected boolean isValidNewEstimate(JiraServiceContext jiraServiceContext, String newEstimate)
    • isValidNewEstimate

      protected boolean isValidNewEstimate(JiraServiceContext jiraServiceContext, String newEstimate, String errorFieldPrefix)
    • isValidAdjustmentAmount

      protected boolean isValidAdjustmentAmount(JiraServiceContext jiraServiceContext, String adjustmentAmount)
      Checks if the given String is a valid amount of time to change an estimate by.
      Parameters:
      jiraServiceContext - JiraServiceContext
      adjustmentAmount - String with amount of time eg "3d 4h"
      Returns:
      true if this change is a valid time.
    • isValidAdjustmentAmount

      protected boolean isValidAdjustmentAmount(JiraServiceContext jiraServiceContext, String adjustmentAmount, String errorFieldPrefix)
      Checks if the given String is a valid amount of time to change an estimate by.
      Parameters:
      jiraServiceContext - JiraServiceContext
      adjustmentAmount - String with amount of time eg "3d 4h"
      errorFieldPrefix - the prefix for the error field
      Returns:
      true if this change is a valid time.
    • isValidWorklogInputFields

      protected boolean isValidWorklogInputFields(JiraServiceContext jiraServiceContext, Issue issue, String timeSpent, Date startDate, String errorFieldPrefix)
    • getDurationForFormattedString

      protected long getDurationForFormattedString(String timeSpent, JiraServiceContext jiraServiceContext)
    • isUserInGroup

      protected boolean isUserInGroup(ApplicationUser user, String groupLevel)
    • isUserInRole

      protected boolean isUserInRole(Long roleLevel, ApplicationUser user, Issue issue)