Package com.atlassian.jira.issue.worklog
Class DefaultTimeTrackingIssueUpdater
java.lang.Object
com.atlassian.jira.issue.worklog.DefaultTimeTrackingIssueUpdater
- All Implemented Interfaces:
TimeTrackingIssueUpdater
-
Field Summary
Fields inherited from interface com.atlassian.jira.issue.worklog.TimeTrackingIssueUpdater
EVENT_ORIGINAL_WORKLOG_PARAMETER
-
Constructor Summary
ConstructorDescriptionDefaultTimeTrackingIssueUpdater
(OfBizDelegator ofBizDelegator, IssueManager issueManager, JiraAuthenticationContext jiraAuthenticationContext, JiraDurationUtils jiraDurationUtils, IssueFactory issueFactory, IssueEventManager issueEventManager, IssueEventBundleFactory issueEventBundleFactory, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
updateIssueOnWorklogCreate
(ApplicationUser user, Worklog worklog, Long newEstimate, boolean dispatchEvent) Will set theWorklog.getIssue()
's remaining estimate to the newEstimate and will increment the issues time spent by theWorklog.getTimeSpent()
.void
updateIssueOnWorklogDelete
(ApplicationUser user, Worklog worklog, Long newEstimate, boolean dispatchEvent) Will set theWorklog.getIssue()
's remaining estimate to the newEstimate and will decrement the issues time spent by theWorklog.getTimeSpent()
.void
updateIssueOnWorklogUpdate
(ApplicationUser user, Worklog originalWorklog, Worklog newWorklog, Long originalTimeSpent, Long newEstimate, boolean dispatchEvent) Will set theWorklog.getIssue()
's remaining estimate to the newEstimate and will decrement the issues time spent by the originalTimeSpent and then increment it by theWorklog.getTimeSpent()
.
-
Constructor Details
-
DefaultTimeTrackingIssueUpdater
public DefaultTimeTrackingIssueUpdater(OfBizDelegator ofBizDelegator, IssueManager issueManager, JiraAuthenticationContext jiraAuthenticationContext, JiraDurationUtils jiraDurationUtils, IssueFactory issueFactory, IssueEventManager issueEventManager, IssueEventBundleFactory issueEventBundleFactory, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
updateIssueOnWorklogCreate
public void updateIssueOnWorklogCreate(ApplicationUser user, Worklog worklog, Long newEstimate, boolean dispatchEvent) Description copied from interface:TimeTrackingIssueUpdater
Will set theWorklog.getIssue()
's remaining estimate to the newEstimate and will increment the issues time spent by theWorklog.getTimeSpent()
.
If the newEstimate is null then the Issue's remaining estimate will not be changed.
This method will generate change items for the updated issue fields and will update the issue's last updated date.- Specified by:
updateIssueOnWorklogCreate
in interfaceTimeTrackingIssueUpdater
- Parameters:
user
- the user performing the action, this user will be available in the dispatched event.worklog
- specifies the new amount of time spent and the issue to update.newEstimate
- if specified this value will over-write the Issue's remaining estimate.dispatchEvent
- if true then aEventType.ISSUE_WORKLOGGED_ID
will be fired, otherwise no event will be fired.
-
updateIssueOnWorklogUpdate
public void updateIssueOnWorklogUpdate(ApplicationUser user, Worklog originalWorklog, Worklog newWorklog, Long originalTimeSpent, Long newEstimate, boolean dispatchEvent) Description copied from interface:TimeTrackingIssueUpdater
Will set theWorklog.getIssue()
's remaining estimate to the newEstimate and will decrement the issues time spent by the originalTimeSpent and then increment it by theWorklog.getTimeSpent()
.
If the newEstimate is null then the Issue's remaining estimate will not be changed.
This method will generate change items for the updated issue fields and will update the issue's last updated date.- Specified by:
updateIssueOnWorklogUpdate
in interfaceTimeTrackingIssueUpdater
- Parameters:
user
- the user performing the action, this user will be available in the dispatched event.originalTimeSpent
- specifies the amount of time spent that was originally specified before the worklog update.newEstimate
- if specified this value will over-write the Issue's remaining estimate.dispatchEvent
- if true then aEventType.ISSUE_WORKLOG_UPDATED_ID
will
-
updateIssueOnWorklogDelete
public void updateIssueOnWorklogDelete(ApplicationUser user, Worklog worklog, Long newEstimate, boolean dispatchEvent) Description copied from interface:TimeTrackingIssueUpdater
Will set theWorklog.getIssue()
's remaining estimate to the newEstimate and will decrement the issues time spent by theWorklog.getTimeSpent()
.
If the newEstimate is null then the Issue's remaining estimate will not be changed.
This method will generate change items for the updated issue fields, the removed worklog, and will update the issue's last updated date.- Specified by:
updateIssueOnWorklogDelete
in interfaceTimeTrackingIssueUpdater
- Parameters:
user
- the user performing the action, this user will be available in the dispatched event.worklog
- specifies the amount of time spent to decrement and the issue to update.newEstimate
- if specified this value will over-write the Issue's remaining estimate.dispatchEvent
- if true then aEventType.ISSUE_WORKLOG_DELETED_ID
will be fired, otherwise no event will be fired.
-