|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.bc.issue.worklog.DefaultWorklogService
public class DefaultWorklogService
Default implemenation of the WorklogService.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.jira.bc.issue.worklog.WorklogService |
---|
WorklogService.WorklogAdjustmentAmountResult, WorklogService.WorklogNewEstimateResult |
Constructor Summary | |
---|---|
DefaultWorklogService(WorklogManager worklogManager,
PermissionManager permissionManager,
VisibilityValidator visibilityValidator,
ApplicationProperties applicationProperties,
ProjectRoleManager projectRoleManager,
IssueManager issueManager)
|
Method Summary | |
---|---|
protected Worklog |
create(JiraServiceContext jiraServiceContext,
Worklog worklog,
Long newEstimate,
boolean dispatchEvent)
|
Worklog |
createAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext,
Worklog worklog,
boolean dispatchEvent)
Persists a new Worklog on the given Issue . |
Worklog |
createAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext,
Worklog worklog,
boolean dispatchEvent)
Persists a new Worklog on the given Issue . |
Worklog |
createWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext,
WorklogService.WorklogAdjustmentAmountResult worklogAdjustmentAmountResult,
boolean dispatchEvent)
Persists a new Worklog on the given Issue . |
Worklog |
createWithNewRemainingEstimate(JiraServiceContext jiraServiceContext,
WorklogService.WorklogNewEstimateResult worklogNewEstimate,
boolean dispatchEvent)
Persists a new Worklog on the given Issue . |
protected boolean |
delete(JiraServiceContext jiraServiceContext,
Worklog worklog,
Long newEstimate,
boolean dispatchEvent)
|
boolean |
deleteAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext,
Worklog worklog,
boolean dispatchEvent)
Deletes the specified Worklog . |
boolean |
deleteAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext,
Worklog worklog,
boolean dispatchEvent)
Deletes the specified Worklog . |
boolean |
deleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext,
WorklogService.WorklogAdjustmentAmountResult worklogAdjustmentAmountResult,
boolean dispatchEvent)
Deletes the specified Worklog . |
boolean |
deleteWithNewRemainingEstimate(JiraServiceContext jiraServiceContext,
WorklogService.WorklogNewEstimateResult worklogNewEstimate,
boolean dispatchEvent)
Deletes the specified Worklog . |
protected Long |
getAutoAdjustNewEstimateOnUpdate(Issue issue,
Long newTimeSpent,
Long originalTimeSpent)
|
Worklog |
getById(JiraServiceContext jiraServiceContext,
Long id)
Used to get a worklog by its id. |
List |
getByIssue(JiraServiceContext jiraServiceContext,
Issue issue)
Returns all child worklogs of a specified issue. |
List |
getByIssueVisibleToUser(JiraServiceContext jiraServiceContext,
Issue issue)
Returns all child worklogs of a specified issue that the provided user has permission to see. |
protected long |
getDurationForFormattedString(String timeSpent)
|
protected boolean |
hasDeleteAllPermission(User user,
Issue issue)
|
protected boolean |
hasDeleteOwnPermission(User user,
Worklog worklog)
|
protected boolean |
hasEditAllPermission(User user,
Issue issue)
|
protected boolean |
hasEditOwnPermission(User user,
Worklog worklog)
|
boolean |
hasPermissionToCreate(JiraServiceContext jiraServiceContext,
Issue issue)
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. |
boolean |
hasPermissionToDelete(JiraServiceContext jiraServiceContext,
Worklog worklog)
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. |
boolean |
hasPermissionToUpdate(JiraServiceContext jiraServiceContext,
Worklog worklog)
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. |
protected Long |
increaseEstimate(Issue issue,
Long amount)
|
boolean |
isIssueInEditableWorkflowState(Issue issue)
Will return true if the issue is in an editable workflow state. |
protected boolean |
isSameAuthor(User user,
Worklog worklog)
|
boolean |
isTimeTrackingEnabled()
Will return true if APKeys.JIRA_OPTION_TIMETRACKING is true, false
otherwise. |
protected boolean |
isUserInGroup(User user,
String groupLevel)
|
protected boolean |
isUserInRole(Long roleLevel,
User user,
Issue issue)
|
protected boolean |
isValidAdjustmentAmount(JiraServiceContext jiraServiceContext,
String adjustmentAmount)
Checks if the given String is a valid amount of time to change an estimate by. |
protected boolean |
isValidDuration(String duration)
|
protected boolean |
isValidNewEstimate(JiraServiceContext jiraServiceContext,
String newEstimate)
|
protected boolean |
isValidWorklogInputFields(JiraServiceContext jiraServiceContext,
Issue issue,
String timeSpent,
Date startDate)
|
protected Long |
reduceEstimate(Issue issue,
Long amount)
|
protected Worklog |
update(JiraServiceContext jiraServiceContext,
Worklog worklog,
Long newEstimate,
boolean dispatchEvent)
|
Worklog |
updateAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext,
Worklog worklog,
boolean dispatchEvent)
Updates the provided Worklog . |
Worklog |
updateAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext,
Worklog worklog,
boolean dispatchEvent)
Updates the provided Worklog . |
Worklog |
updateWithNewRemainingEstimate(JiraServiceContext jiraServiceContext,
WorklogService.WorklogNewEstimateResult worklogNewEstimate,
boolean dispatchEvent)
Updates the provided Worklog . |
Worklog |
validateCreate(JiraServiceContext jiraServiceContext,
Issue issue,
String timeSpent,
Date startDate,
String comment,
String groupLevel,
String roleLevelId)
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)
to create a worklog for this issue. |
WorklogService.WorklogAdjustmentAmountResult |
validateCreateWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext,
Issue issue,
String timeSpent,
Date startDate,
String comment,
String groupLevel,
String roleLevelId,
String adjustmentAmount)
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)
to create a worklog for this issue. |
WorklogService.WorklogNewEstimateResult |
validateCreateWithNewEstimate(JiraServiceContext jiraServiceContext,
Issue issue,
String timeSpent,
Date startDate,
String comment,
String groupLevel,
String roleLevelId,
String newEstimate)
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)
to create a worklog for this issue. |
Worklog |
validateDelete(JiraServiceContext jiraServiceContext,
Long worklogId)
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. |
WorklogService.WorklogAdjustmentAmountResult |
validateDeleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext,
Long worklogId,
String adjustmentAmount)
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. |
WorklogService.WorklogNewEstimateResult |
validateDeleteWithNewEstimate(JiraServiceContext jiraServiceContext,
Long worklogId,
String newEstimate)
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. |
protected Worklog |
validateParamsAndCreateWorklog(JiraServiceContext jiraServiceContext,
Issue issue,
String author,
String groupLevel,
String roleLevelId,
String timeSpent,
Date startDate,
Long worklogId,
String comment,
Date created,
Date updated,
String updateAuthor)
|
Worklog |
validateUpdate(JiraServiceContext jiraServiceContext,
Long worklogId,
String timeSpent,
Date startDate,
String comment,
String groupLevel,
String roleLevelId)
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. |
WorklogService.WorklogNewEstimateResult |
validateUpdateWithNewEstimate(JiraServiceContext jiraServiceContext,
Long worklogId,
String timeSpent,
Date startDate,
String comment,
String groupLevel,
String roleLevelId,
String newEstimate)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultWorklogService(WorklogManager worklogManager, PermissionManager permissionManager, VisibilityValidator visibilityValidator, ApplicationProperties applicationProperties, ProjectRoleManager projectRoleManager, IssueManager issueManager)
Method Detail |
---|
public Worklog validateDelete(JiraServiceContext jiraServiceContext, Long worklogId)
WorklogService
WorklogService.hasPermissionToDelete(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.worklog.Worklog)
to delete a worklog for this issue.
validateDelete
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodworklogId
- identifies the worklog that the update validation will occur against
public WorklogService.WorklogNewEstimateResult validateDeleteWithNewEstimate(JiraServiceContext jiraServiceContext, Long worklogId, String newEstimate)
WorklogService
WorklogService.hasPermissionToDelete(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.worklog.Worklog)
to delete a worklog for this issue.
validateDeleteWithNewEstimate
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodworklogId
- identifies the worklog that the delete validation will occur againstnewEstimate
- The value to change the issues remaining estimate to.
public WorklogService.WorklogAdjustmentAmountResult validateDeleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, Long worklogId, String adjustmentAmount)
WorklogService
WorklogService.hasPermissionToDelete(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.worklog.Worklog)
to delete a worklog for this issue.
validateDeleteWithManuallyAdjustedEstimate
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodworklogId
- identifies the worklog that the delete validation will occur againstadjustmentAmount
- The value to increase the issues remaining estimate by.
public boolean deleteWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogService.WorklogNewEstimateResult worklogNewEstimate, boolean dispatchEvent)
WorklogService
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.
deleteWithNewRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to update the supplied worklog and
the ErrorCollection
that will contain any errors encountered
in calling the methodworklogNewEstimate
- 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.
Worklog
was successfully deleted, false otherwisepublic boolean deleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogService.WorklogAdjustmentAmountResult worklogAdjustmentAmountResult, boolean dispatchEvent)
WorklogService
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.
deleteWithManuallyAdjustedEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to update the supplied worklog and
the ErrorCollection
that will contain any errors encountered
in calling the methodworklogAdjustmentAmountResult
- 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.
Worklog
was successfully deleted, false otherwisepublic boolean deleteAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, Worklog worklog, boolean dispatchEvent)
WorklogService
Worklog
. This method will
make no adjustment to the issues remaining estimate.
deleteAndRetainRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to update the supplied worklog and
the ErrorCollection
that will contain any errors encountered
in calling the methodworklog
- Deletes a worklog from the datastore (identified by its id). This should have been generated by a call to
WorklogService.validateDelete(com.atlassian.jira.bc.JiraServiceContext,Long)
dispatchEvent
- whether or not you want to have an event dispatched on Worklog delete
Worklog
was successfully deleted, false otherwisepublic boolean deleteAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, Worklog worklog, boolean dispatchEvent)
WorklogService
Worklog
. This method will auto-adjust the issues
remaining estimate by adding the time spent on the deleted worklog.
deleteAndAutoAdjustRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to update the supplied worklog and
the ErrorCollection
that will contain any errors encountered
in calling the methodworklog
- Deletes a worklog from the datastore (identified by its id). This should have been generated by a call to
WorklogService.validateDelete(com.atlassian.jira.bc.JiraServiceContext,Long)
dispatchEvent
- whether or not you want to have an event dispatched on Worklog delete
Worklog
was successfully deleted, false otherwisepublic Worklog validateUpdate(JiraServiceContext jiraServiceContext, Long worklogId, String timeSpent, Date startDate, String comment, String groupLevel, String roleLevelId)
WorklogService
WorklogService.hasPermissionToUpdate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.worklog.Worklog)
to update a worklog for this issue.
validateUpdate
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodworklogId
- identifies the worklog that the update validation will occur againsttimeSpent
- the time spent on the workstartDate
- the date on which the work was performedcomment
- The body of the comment associated with the workloggroupLevel
- The group level visibility of the worklog (null if roleLevelId specified)roleLevelId
- The role level id visibility of the worklog (null if groupLevel specified)
public WorklogService.WorklogNewEstimateResult validateUpdateWithNewEstimate(JiraServiceContext jiraServiceContext, Long worklogId, String timeSpent, Date startDate, String comment, String groupLevel, String roleLevelId, String newEstimate)
WorklogService
WorklogService.hasPermissionToUpdate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.worklog.Worklog)
to update a worklog for this issue.
validateUpdateWithNewEstimate
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodworklogId
- identifies the worklog that the update validation will occur againsttimeSpent
- the time spent on the workstartDate
- the date on which the work was performedcomment
- The body of the comment associated with the workloggroupLevel
- The group level visibility of the worklog (null if roleLevelId specified)roleLevelId
- The role level id visibility of the worklog (null if groupLevel specified)newEstimate
- The value to change the issues remaining estimate to.
public Worklog updateWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogService.WorklogNewEstimateResult worklogNewEstimate, boolean dispatchEvent)
WorklogService
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.
updateWithNewRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodworklogNewEstimate
- 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.
public Worklog updateAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, Worklog worklog, boolean dispatchEvent)
WorklogService
Worklog
. This method will
make no adjustment to the issues remaining estimate.
updateAndRetainRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to update the supplied worklog and
the ErrorCollection
that will contain any errors encountered
in calling the methodworklog
- Updates fields of an existing worklog in the datastore (identified by its id) with the
supplied worklog.This should have been generated by a call to
WorklogService.validateUpdate(com.atlassian.jira.bc.JiraServiceContext,Long,String,java.util.Date,String,String,String)
dispatchEvent
- whether or not you want to have an event dispatched on Worklog update
public Worklog updateAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, Worklog worklog, boolean dispatchEvent)
WorklogService
Worklog
. This method will auto-adjust the issues
remaining estimate based on the updated value of the time spent on the work.
updateAndAutoAdjustRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to update the worklog and
the ErrorCollection
that will contain any errors
in calling the methodworklog
- Updates fields of an existing worklog in the datastore (identified by its id) with the
supplied worklog. This should have been generated by a call to
WorklogService.validateCreate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.Issue,String,java.util.Date,String,String,String)
dispatchEvent
- whether or not you want to have an event dispatched on Worklog update
protected boolean delete(JiraServiceContext jiraServiceContext, Worklog worklog, Long newEstimate, boolean dispatchEvent)
protected Worklog update(JiraServiceContext jiraServiceContext, Worklog worklog, Long newEstimate, boolean dispatchEvent)
public Worklog validateCreate(JiraServiceContext jiraServiceContext, Issue issue, String timeSpent, Date startDate, String comment, String groupLevel, String roleLevelId)
WorklogService
WorklogService.hasPermissionToCreate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.Issue)
to create a worklog for this issue.
validateCreate
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodissue
- that will have a worklog associated with ittimeSpent
- the time spent on the workstartDate
- the date on which the work was performedcomment
- The body of the comment associated with the workloggroupLevel
- The group level visibility of the worklog (null if roleLevelId specified)roleLevelId
- The role level id visibility of the worklog (null if groupLevel specified)
public WorklogService.WorklogNewEstimateResult validateCreateWithNewEstimate(JiraServiceContext jiraServiceContext, Issue issue, String timeSpent, Date startDate, String comment, String groupLevel, String roleLevelId, String newEstimate)
WorklogService
WorklogService.hasPermissionToCreate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.Issue)
to create a worklog for this issue.
validateCreateWithNewEstimate
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodissue
- that will have a worklog associated with ittimeSpent
- the time spent on the workstartDate
- the date on which the work was performedcomment
- The body of the comment associated with the workloggroupLevel
- The group level visibility of the worklog (null if roleLevelId specified)roleLevelId
- The role level id visibility of the worklog (null if groupLevel specified)newEstimate
- The value to change the issue's remaining estimate to.
public WorklogService.WorklogAdjustmentAmountResult validateCreateWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, Issue issue, String timeSpent, Date startDate, String comment, String groupLevel, String roleLevelId, String adjustmentAmount)
WorklogService
WorklogService.hasPermissionToCreate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.Issue)
to create a worklog for this issue.
validateCreateWithManuallyAdjustedEstimate
in interface WorklogService
jiraServiceContext
- containing the user who wishes to create a worklog and the errorCollection
that will contain any errors in calling the methodissue
- that will have a worklog associated with ittimeSpent
- the time spent on the workstartDate
- the date on which the work was performedcomment
- The body of the comment associated with the workloggroupLevel
- The group level visibility of the worklog (null if roleLevelId specified)roleLevelId
- The role level id visibility of the worklog (null if groupLevel specified)adjustmentAmount
- The amount to adjust the issue's remaining estimate by.
public Worklog createWithNewRemainingEstimate(JiraServiceContext jiraServiceContext, WorklogService.WorklogNewEstimateResult worklogNewEstimate, boolean dispatchEvent)
WorklogService
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.
createWithNewRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodworklogNewEstimate
- the Worklog and new estimate for the issue.dispatchEvent
- whether or not you want to have an event dispatched on Worklog creation
public Worklog createWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogService.WorklogAdjustmentAmountResult worklogAdjustmentAmountResult, boolean dispatchEvent)
WorklogService
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.
createWithManuallyAdjustedEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodworklogAdjustmentAmountResult
- the Worklog and adjustmentAmount for the issue.dispatchEvent
- whether or not you want to have an event dispatched on Worklog creation
WorklogService.validateCreateWithManuallyAdjustedEstimate(com.atlassian.jira.bc.JiraServiceContext, com.atlassian.jira.issue.Issue, java.lang.String, java.util.Date, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public Worklog createAndRetainRemainingEstimate(JiraServiceContext jiraServiceContext, Worklog worklog, boolean dispatchEvent)
WorklogService
Worklog
on the given Issue
. This method will
make no adjustment to the issues remaining estimate.
createAndRetainRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodworklog
- Is the worklog to persist to the datastore. This should have been generated by a call to
WorklogService.validateCreate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.Issue,String,java.util.Date,String,String,String)
dispatchEvent
- whether or not you want to have an event dispatched on Worklog creation
public Worklog createAndAutoAdjustRemainingEstimate(JiraServiceContext jiraServiceContext, Worklog worklog, boolean dispatchEvent)
WorklogService
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.
createAndAutoAdjustRemainingEstimate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodworklog
- Is the worklog to persist to the datastore. This should have been generated by a call to
WorklogService.validateCreate(com.atlassian.jira.bc.JiraServiceContext,com.atlassian.jira.issue.Issue,String,java.util.Date,String,String,String)
dispatchEvent
- whether or not you want to have an event dispatched on Worklog creation
public boolean hasPermissionToCreate(JiraServiceContext jiraServiceContext, Issue issue)
WorklogService
Permissions.WORK_ISSUE
permission,
that timetracking is enabled in JIRA and that the associated issue is in an editable workflow state.
hasPermissionToCreate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodissue
- the issue to add the worklog to
public boolean hasPermissionToUpdate(JiraServiceContext jiraServiceContext, Worklog worklog)
WorklogService
Permissions.WORKLOG_EDIT_ALL
permission; ORWorklog
author and has the Permissions.WORKLOG_EDIT_OWN
permission
hasPermissionToUpdate
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to update the worklog and
the ErrorCollection
that will contain any errors
in calling the methodworklog
- the Worklog
the user wishes to update
public boolean hasPermissionToDelete(JiraServiceContext jiraServiceContext, Worklog worklog)
WorklogService
Permissions.WORKLOG_DELETE_ALL
permission; ORWorklog
author and has the Permissions.WORKLOG_DELETE_OWN
permission
hasPermissionToDelete
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to delete the worklog and
the ErrorCollection
that will contain any errors
in calling the methodworklog
- the Worklog
the user wishes to delete
public Worklog getById(JiraServiceContext jiraServiceContext, Long id)
WorklogService
getById
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodid
- uniquely identifies the worklog
public List getByIssue(JiraServiceContext jiraServiceContext, Issue issue)
WorklogService
getByIssue
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodissue
- the specified parent issue (not null)
public List getByIssueVisibleToUser(JiraServiceContext jiraServiceContext, Issue issue)
WorklogService
getByIssueVisibleToUser
in interface WorklogService
jiraServiceContext
- containing the User
who wishes to create a worklog and
the ErrorCollection
that will contain any errors in calling the methodissue
- the specified parent issue (not null)
public boolean isTimeTrackingEnabled()
WorklogService
APKeys.JIRA_OPTION_TIMETRACKING
is true, false
otherwise.
isTimeTrackingEnabled
in interface WorklogService
public boolean isIssueInEditableWorkflowState(Issue issue)
WorklogService
isIssueInEditableWorkflowState
in interface WorklogService
issue
- the issue to see if it is in an editable store
protected Worklog validateParamsAndCreateWorklog(JiraServiceContext jiraServiceContext, Issue issue, String author, String groupLevel, String roleLevelId, String timeSpent, Date startDate, Long worklogId, String comment, Date created, Date updated, String updateAuthor)
protected Worklog create(JiraServiceContext jiraServiceContext, Worklog worklog, Long newEstimate, boolean dispatchEvent)
protected boolean hasEditOwnPermission(User user, Worklog worklog)
protected boolean hasEditAllPermission(User user, Issue issue)
protected boolean hasDeleteOwnPermission(User user, Worklog worklog)
protected boolean hasDeleteAllPermission(User user, Issue issue)
protected boolean isSameAuthor(User user, Worklog worklog)
protected Long getAutoAdjustNewEstimateOnUpdate(Issue issue, Long newTimeSpent, Long originalTimeSpent)
protected Long reduceEstimate(Issue issue, Long amount)
protected Long increaseEstimate(Issue issue, Long amount)
protected boolean isValidNewEstimate(JiraServiceContext jiraServiceContext, String newEstimate)
protected boolean isValidAdjustmentAmount(JiraServiceContext jiraServiceContext, String adjustmentAmount)
jiraServiceContext
- JiraServiceContextadjustmentAmount
- String with amount of time eg "3d 4h"
protected boolean isValidWorklogInputFields(JiraServiceContext jiraServiceContext, Issue issue, String timeSpent, Date startDate)
protected boolean isValidDuration(String duration)
protected long getDurationForFormattedString(String timeSpent)
protected boolean isUserInGroup(User user, String groupLevel)
protected boolean isUserInRole(Long roleLevel, User user, Issue issue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |