Package com.atlassian.jira.issue.worklog
Interface WorklogStore
- All Known Implementing Classes:
DatabaseWorklogStore
public interface WorklogStore
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new worklog in the data store based on the values in the passed in Worklog object.booleanDeletes a worklog from the data store based on the passed in id.longdeleteWorklogsForIssue(Issue issue) Deletes all worklogs which are related to the givenIssue.Returns a worklog specified by it's idgetByIssue(Issue issue) Returns all child worklogs of a specified issuelonggetCountForWorklogsRestrictedByGroup(String groupName) Returns the count of allWorklog's that have a visibility restriction of the provided group.longReturns the count of allWorklog's that have a visibility restriction of the provided role.getWorklogsDeletedSince(Long sinceInMilliseconds, int maxResults) ReturnsWorklogManager.WORKLOG_UPDATE_DATA_PAGE_SIZEof worklog ids and removal dates, which were removed after (inclusive) provided time in milliseconds.getWorklogsForIds(Set<Long> worklogIds, int maxResults) Returns a set of worklogs for provided ids.getWorklogsUpdateSince(Long sinceInMilliseconds, int maxResults) Returns of worklogs, which were updated or created after (inclusive) provided time in milliseconds.intswapWorklogGroupRestriction(String groupName, String swapGroup) UpdatesWorklog's such that worklogs that have a visibility restriction of the provided groupName will be changed to have a visibility restriction of the provided swapGroup.intswapWorklogRoleRestriction(Long roleId, Long swapRoleId) UpdatesWorklog's such that worklogs that have a visibility restriction of the provided role will be changed to have a visibility restriction to the provided swapRole.Updates fields of an existing worklog in the datastore (identified by its id) with the supplied worklog.
-
Method Details
-
update
Updates fields of an existing worklog in the datastore (identified by its id) with the supplied worklog.- Parameters:
worklog- identifies the worklog to update and provides the updated values.- Returns:
- the updated worklog.
-
create
Creates a new worklog in the data store based on the values in the passed in Worklog object.- Parameters:
worklog- specifies the values to create the worklog with.- Returns:
- the representation of the created worklog, including the id.
-
delete
Deletes a worklog from the data store based on the passed in id.- Parameters:
worklogId- specifies which worklog to delete (not null)- Returns:
- true if the worklog was deleted, false otherwise
- Throws:
IllegalArgumentException- if the worklogId is null.
-
deleteWorklogsForIssue
Deletes all worklogs which are related to the givenIssue.- Parameters:
issue- issue for which worklogs will be removed- Returns:
- the number of worklogs deleted
- Throws:
IllegalArgumentException- if the issue or issue's id is null.
-
getById
Returns a worklog specified by it's id- Parameters:
id- the specified id (not null)- Returns:
- the specified worklog, or null if not found
-
getByIssue
Returns all child worklogs of a specified issue- Parameters:
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
-
getCountForWorklogsRestrictedByGroup
Returns the count of allWorklog's that have a visibility restriction of the provided group.- Parameters:
groupName- identifies the group the worklogs are restricted by, this must not be null.- Returns:
- the count of restricted groups
- Since:
- v3.12
-
getCountForWorklogsRestrictedByRole
Returns the count of allWorklog's that have a visibility restriction of the provided role.- Parameters:
roleId- identifies the role the worklogs are restricted by, this must not be null.- Returns:
- the count of restricted worklogs
- Since:
- v7.0
-
swapWorklogGroupRestriction
UpdatesWorklog's such that worklogs that have a visibility restriction of the provided groupName will be changed to have a visibility restriction of the provided swapGroup.Note: There is no validation performed by this method to determine if the provided swapGroup is a valid group with JIRA. This validation must be done by the caller.
- Parameters:
groupName- identifies the group the worklogs are restricted by, this must not be null.swapGroup- identifies the group the worklogs will be changed to be restricted by, this must not be null.- Returns:
- tbe number of worklogs affected by the update.
- Since:
- v3.12
-
swapWorklogRoleRestriction
UpdatesWorklog's such that worklogs that have a visibility restriction of the provided role will be changed to have a visibility restriction to the provided swapRole.Note: There is no validation performed by this method to determine if the provided swapRoleId is a valid group with JIRA. This validation must be done by the caller.
- Parameters:
roleId- identifies the role the worklogs are restricted by, this must not be null.swapRoleId- identifies the role the worklogs will be changed to be restricted by, this must not be null.- Returns:
- the number of worklogs affected by the update.
- Since:
- v7.0
-
getWorklogsUpdateSince
Returns of worklogs, which were updated or created after (inclusive) provided time in milliseconds. Returned worklogs are ordered by the update time.- Parameters:
sinceInMilliseconds- the time (measured as a difference between the timestamp and midnight, January 1, 1970 UTC) since which the modified worklogs will be returned.maxResults- the maximum number of worklogs to return.- Returns:
- the list of worklogs updated after provided time.
-
getWorklogsDeletedSince
ReturnsWorklogManager.WORKLOG_UPDATE_DATA_PAGE_SIZEof worklog ids and removal dates, which were removed after (inclusive) provided time in milliseconds.- Parameters:
sinceInMilliseconds- the time (measured as a difference between the timestamp and midnight, January 1, 1970 UTC) since which the modified worklogs will be returned.maxResults- the maximum number ofDeletedWorklogto return.- Returns:
- ids and removal dates of worklogs which were deleted since provided time.
-
getWorklogsForIds
Returns a set of worklogs for provided ids.- Parameters:
worklogIds- set of worklog ids.maxResults- the maximu number ofWorklogto return.- Returns:
- a list of worklogs for provided ids.
-