public class IssueResource extends Object
Constructor and Description |
---|
IssueResource(JiraAuthenticationContext authContext,
UserManager userManager,
VoteService voteService,
I18nHelper i18n,
WatchersFinder watchersFinder,
WatcherService watcherService,
BeanBuilderFactory beanBuilderFactory,
ContextUriInfo contextUriInfo,
IssueFinder issueFinder,
CreateIssueResource createIssueResource,
UpdateIssueResource updateIssueResource,
DeleteIssueResource deleteIssueResource,
ArchiveIssueResource archiveIssueResource,
RemoteIssueLinkResource remoteIssueLinkResource,
IssueWorklogResource issueWorklogResource,
CommentResource commentResource,
IssueWorkflowManager issueWorkflowManager,
AssignIssueResource assignIssueResource,
AdhocNotificationService notificationService,
JiraBaseUrls jiraBaseUrls,
IssuePicker issuePicker,
OrderByRequestParser orderByRequestParser,
ResponseFactory responseFactory,
IssuePropertiesLoader issuePropertiesLoader,
FeatureManager featureManager,
UserIssueHistoryManager userIssueHistoryManager) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addComment(String issueIdOrKey,
String expand,
CommentJsonBean request)
Adds a new comment to an issue.
|
javax.ws.rs.core.Response |
addVote(String issueIdOrKey)
Cast your vote in favour of an issue.
|
javax.ws.rs.core.Response |
addWatcher(String issueIdOrKey,
String userName)
Adds a user to an issue's watcher list.
|
javax.ws.rs.core.Response |
addWorklog(String issueIdOrKey,
String adjustEstimate,
String newEstimate,
String reduceBy,
WorklogJsonBean request)
Adds a new worklog entry to an issue.
|
javax.ws.rs.core.Response |
archiveIssue(String issueIdOrKey,
boolean notifyUsers)
Archives an issue.
|
javax.ws.rs.core.Response |
archiveIssues(List<String> issueKeys,
boolean notifyUsers)
Archives a list of issues.
|
javax.ws.rs.core.Response |
assign(String issueIdOrKey,
UserBean assigneeBean)
Assigns an issue to a user.
|
protected javax.ws.rs.core.Response |
BAD_REQUEST()
Returns a Response with a status code of 400.
|
javax.ws.rs.core.Response |
createIssue(boolean updateHistory,
IssueUpdateBean createRequest)
Creates an issue or a sub-task from a JSON representation.
|
javax.ws.rs.core.Response |
createIssues(IssuesUpdateBean createRequest)
Creates issues or sub-tasks from a JSON representation.
|
javax.ws.rs.core.Response |
createOrUpdateRemoteIssueLink(String issueIdOrKey,
RemoteIssueLinkCreateOrUpdateRequest request)
Creates or updates a remote issue link from a JSON representation.
|
javax.ws.rs.core.Response |
deleteComment(String issueIdOrKey,
String commentId)
Deletes an existing comment .
|
javax.ws.rs.core.Response |
deleteIssue(String issueIdOrKey,
String deleteSubtasks)
Delete an issue.
|
javax.ws.rs.core.Response |
deleteRemoteIssueLinkByGlobalId(String issueIdOrKey,
String globalId)
Delete the remote issue link with the given global id on the issue.
|
javax.ws.rs.core.Response |
deleteRemoteIssueLinkById(String issueIdOrKey,
String remoteIssueLinkId)
Delete the remote issue link with the given id on the issue.
|
javax.ws.rs.core.Response |
deleteWorklog(String issueIdOrKey,
String worklogId,
String adjustEstimate,
String newEstimate,
String increaseBy)
Deletes an existing worklog entry.
|
javax.ws.rs.core.Response |
doTransition(String issueIdOrKey,
IssueUpdateBean issueUpdateBean)
Perform a transition on an issue.
|
javax.ws.rs.core.Response |
editIssue(String issueIdOrKey,
boolean notifyUsers,
IssueUpdateBean updateRequest)
Edits an issue from a JSON representation.
|
javax.ws.rs.core.Response |
getComment(String issueIdOrKey,
String commentId,
String expand)
Returns a single comment.
|
javax.ws.rs.core.Response |
getComments(String issueIdOrKey,
Long startAt,
Integer maxResults,
String orderBy,
String expand)
Returns all comments for an issue.
|
javax.ws.rs.core.Response |
getCreateIssueMeta(List<StringList> projectIds,
List<StringList> projectKeys,
List<StringList> issuetypeIds,
List<String> issuetypeNames,
javax.ws.rs.core.UriInfo uriInfo)
Deprecated.
Please use extended "createmeta" endpoints. This endpoint can cause serious performance issues and will be removed in version 9.
|
javax.ws.rs.core.Response |
getCreateIssueMetaFields(String projectIdOrKey,
String issueTypeId,
long startAt,
int maxResults) |
javax.ws.rs.core.Response |
getCreateIssueMetaProjectIssueTypes(String projectIdOrKey,
long startAt,
int maxResults) |
javax.ws.rs.core.Response |
getEditIssueMeta(String issueIdOrKey)
Returns the meta data for editing an issue.
|
javax.ws.rs.core.Response |
getIssue(String issueIdOrKey,
List<StringList> fields,
String expand,
List<StringList> properties,
boolean updateHistory)
Returns a full representation of the issue for the given issue key.
|
javax.ws.rs.core.Response |
getIssuePickerResource(String query,
String currentJQL,
String currentIssueKey,
String currentProjectId,
boolean showSubTasks,
boolean showSubTaskParent)
Returns suggested issues which match the auto-completion query for the user which executes this request.
|
javax.ws.rs.core.Response |
getIssueWatchers(String issueIdOrKey)
Returns the list of watchers for the issue with the given key.
|
javax.ws.rs.core.Response |
getIssueWorklog(String issueIdOrKey)
Returns all work logs for an issue.
|
javax.ws.rs.core.Response |
getRemoteIssueLinkById(String issueIdOrKey,
String linkId)
Get the remote issue link with the given id on the issue.
|
javax.ws.rs.core.Response |
getRemoteIssueLinks(String issueIdOrKey,
String globalId)
A REST sub-resource representing the remote issue links on the issue.
|
Collection<FieldMetaBean> |
getRequiredFields(FieldScreenRenderer fieldScreenRenderer,
Issue issue) |
javax.ws.rs.core.Response |
getTransitions(String issueIdOrKey,
String transitionId)
Get a list of the transitions possible for this issue by the current user, along with fields that are required and their types.
|
javax.ws.rs.core.Response |
getVotes(String issueIdOrKey)
A REST sub-resource representing the voters on the issue.
|
javax.ws.rs.core.Response |
getWorklog(String issueIdOrKey,
String worklogId)
Returns a specific worklog.
|
protected static javax.ws.rs.core.Response |
NO_CONTENT()
Returns a Response with a status code of 204.
|
javax.ws.rs.core.Response |
notify(String issueIdOrKey,
NotificationJsonBean request)
Sends a notification (email) to the list or recipients defined in the request.
|
javax.ws.rs.core.Response |
removeVote(String issueIdOrKey)
Remove your vote from an issue.
|
javax.ws.rs.core.Response |
removeWatcher(String issueIdOrKey,
String userName)
Removes a user from an issue's watcher list.
|
javax.ws.rs.core.Response |
restoreIssue(String issueIdOrKey,
boolean notifyUsers)
Restores an archived issue.
|
javax.ws.rs.core.Response |
updateComment(String issueIdOrKey,
String commentId,
String expand,
CommentJsonBean request)
Updates an existing comment using its JSON representation.
|
javax.ws.rs.core.Response |
updateRemoteIssueLink(String issueIdOrKey,
String linkId,
RemoteIssueLinkCreateOrUpdateRequest updateRequest)
Updates a remote issue link from a JSON representation.
|
javax.ws.rs.core.Response |
updateWorklog(String issueIdOrKey,
String worklogId,
String adjustEstimate,
String newEstimate,
WorklogJsonBean request)
Updates an existing worklog entry.
|
public IssueResource(JiraAuthenticationContext authContext, UserManager userManager, VoteService voteService, I18nHelper i18n, WatchersFinder watchersFinder, WatcherService watcherService, BeanBuilderFactory beanBuilderFactory, ContextUriInfo contextUriInfo, IssueFinder issueFinder, CreateIssueResource createIssueResource, UpdateIssueResource updateIssueResource, DeleteIssueResource deleteIssueResource, ArchiveIssueResource archiveIssueResource, RemoteIssueLinkResource remoteIssueLinkResource, IssueWorklogResource issueWorklogResource, CommentResource commentResource, IssueWorkflowManager issueWorkflowManager, AssignIssueResource assignIssueResource, AdhocNotificationService notificationService, JiraBaseUrls jiraBaseUrls, IssuePicker issuePicker, OrderByRequestParser orderByRequestParser, ResponseFactory responseFactory, IssuePropertiesLoader issuePropertiesLoader, FeatureManager featureManager, UserIssueHistoryManager userIssueHistoryManager)
public javax.ws.rs.core.Response getTransitions(String issueIdOrKey, String transitionId)
expand=transitions.fields
.
The fields in the metadata correspond to the fields in the transition screen for that transition.
Fields not in the screen will not be in the metadata.issueIdOrKey
- the issue whose transitions you want to viewpublic javax.ws.rs.core.Response getIssuePickerResource(String query, String currentJQL, String currentIssueKey, String currentProjectId, boolean showSubTasks, boolean showSubTaskParent)
query
- the query.currentJQL
- the JQL in context of which the request is executed. Only issues which match this JQL query will be included in results.currentIssueKey
- the key of the issue in context of which the request is executed. The issue which is in context will not be included in the auto-completion result, even if it matches the query.currentProjectId
- the id of the project in context of which the request is executed. Suggested issues will be only from this project.showSubTasks
- if set to false, subtasks will not be included in the list.showSubTaskParent
- if set to false and request is executed in context of a subtask, the parent issue will not be included in the auto-completion result, even if it matches the query.public javax.ws.rs.core.Response doTransition(String issueIdOrKey, IssueUpdateBean issueUpdateBean)
updateHistory
param adds the issues retrieved by this method to the current user's issue history,
if set to true (by default, the issue history does not include issues retrieved via the REST API).
You can view the issue history in the Jira application, via the Issues dropdown or by using the
lastViewed
JQL field in an issue search.issueIdOrKey
- the issue you want to transitionissueUpdateBean
- The json containing the transition to peform and which field values to update.public javax.ws.rs.core.Response removeVote(String issueIdOrKey)
issueIdOrKey
- the issue the current user is unvoting onpublic javax.ws.rs.core.Response addVote(String issueIdOrKey)
issueIdOrKey
- the issue to vote forpublic javax.ws.rs.core.Response getVotes(String issueIdOrKey)
issueIdOrKey
- the issue to view voting information forpublic javax.ws.rs.core.Response getIssue(String issueIdOrKey, List<StringList> fields, String expand, List<StringList> properties, boolean updateHistory)
An issue JSON consists of the issue key, a collection of fields, a link to the workflow transition sub-resource, and (optionally) the HTML rendered values of any fields that support it (e.g. if wiki syntax is enabled for the description or comments).
The fields
param (which can be specified multiple times) gives a comma-separated list of fields
to include in the response. This can be used to retrieve a subset of fields.
A particular field can be excluded by prefixing it with a minus.
By default, all (*all
) fields are returned in this get-issue resource. Note: the default is different
when doing a jql search -- the default there is just navigable fields (*navigable
).
*all
- include all fields*navigable
- include just navigable fieldssummary,comment
- include just the summary and comments-comment
- include everything except comments (the default is *all
for get-issue)*all,-comment
- include everything except comments
The properties
param is similar to fields
and specifies a comma-separated list of issue
properties to include. Unlike fields
, properties are not included by default. To include them all
send ?properties=*all
. You can also include only specified properties or exclude some properties
with a minus (-) sign.
*all
- include all properties*all, -prop1
- include all properties except prop1
prop1, prop1
- include prop1
and prop2
properties issueIdOrKey
path parameter. This can be an issue id,
or an issue key. If the issue cannot be found via an exact match, Jira will also look for the issue in a case-insensitive way, or
by looking to see if the issue was moved. In either of these cases, the request will proceed as normal (a 302 or other redirect
will not be returned). The issue key contained in the response will indicate the current value of issue's key.
The expand
param is used to include, hidden by default, parts of response. This can be used to include:
renderedFields
- field values in HTML formatnames
- display name of each fieldschema
- schema for each field which describes a type of the fieldtransitions
- all possible transitions for the given issueoperations
- all possibles operations which may be applied on issueeditmeta
- information about how each field may be edited. It contains field's schema as well.changelog
- history of all changes of the given issueversionedRepresentations
-
REST representations of all fields. Some field may contain more recent versions. RESET representations are numbered.
The greatest number always represents the most recent version. It is recommended that the most recent version is used.
version for these fields which provide a more recent REST representation.
After including versionedRepresentations
"fields" field become hidden.issueIdOrKey
- the issue id or key to request (i.e. JRA-1330)fields
- the list of fields to return for the issue. By default, all fields are returned.properties
- the list of properties to return for the issue. By default no properties are returned.public javax.ws.rs.core.Response getIssueWatchers(String issueIdOrKey)
issueIdOrKey
- the issue key to request (i.e. JRA-1330)public javax.ws.rs.core.Response addWatcher(String issueIdOrKey, String userName)
issueIdOrKey
- a String containing an issue keyuserName
- the name of the user to add to the watcher list. If no name is specified, the current user is added.public javax.ws.rs.core.Response removeWatcher(String issueIdOrKey, String userName)
issueIdOrKey
- a String containing an issue key.userName
- a String containing the name of the user to remove from the watcher list. Must not be null.public javax.ws.rs.core.Response createIssue(boolean updateHistory, IssueUpdateBean createRequest)
issueType
field must correspond to a sub-task issue type (you can use
/issue/createmeta
to discover sub-task issue types), andparent
field in the issue create request containing the id or key of the
parent issue.updateHistory
param adds the project that this issue is created in, to the current user's project history,
if set to true (by default, the project history is not updated).updateHistory
- if true then the user's project history is updatedcreateRequest
- an issue create requestpublic javax.ws.rs.core.Response createIssues(IssuesUpdateBean createRequest)
IssueResource#createIssue(IssueUpdateBean)
}createRequest
- IssuesUpdateBean
which wraps issues to create in collection of IssueUpdateBean}public javax.ws.rs.core.Response deleteIssue(String issueIdOrKey, String deleteSubtasks)
issueIdOrKey
- a String containing an issue id or keydeleteSubtasks
- a String of true or false indicating that any subtasks should also be deleted. If the
issue has no subtasks this parameter is ignored. If the issue has subtasks and this parameter is missing or false,
then the issue will not be deleted and an error will be returned.public javax.ws.rs.core.Response archiveIssue(String issueIdOrKey, boolean notifyUsers)
issueIdOrKey
- Issue id or issue keynotifyUsers
- send the email with notification that the issue was updated to users that watch it.
Admin or project admin permissions are required to disable the notification.public javax.ws.rs.core.Response archiveIssues(@RequestBody List<String> issueKeys, boolean notifyUsers)
issueKeys
- List of issue keysnotifyUsers
- send the email with notification that the issue was updated to users that watch it.
Admin or project admin permissions are required to disable the notification.public javax.ws.rs.core.Response restoreIssue(String issueIdOrKey, boolean notifyUsers)
issueIdOrKey
- Issue id or issue keynotifyUsers
- send the email with notification that the issue was updated to users that watch it.
Admin or project admin permissions are required to disable the notification.@Deprecated public javax.ws.rs.core.Response getCreateIssueMeta(List<StringList> projectIds, List<StringList> projectKeys, List<StringList> issuetypeIds, List<String> issuetypeNames, @Context javax.ws.rs.core.UriInfo uriInfo)
expand=projects.issuetypes.fields
.
The results can be filtered by project and/or issue type, given by the query params.projectIds
- combined with the projectKeys param, lists the projects with which to filter the results. If absent, all projects are returned.
This parameter can be specified multiple times, and/or be a comma-separated list.
Specifiying a project that does not exist (or that you cannot create issues in) is not an error, but it will not be in the results.projectKeys
- combined with the projectIds param, lists the projects with which to filter the results. If null, all projects are returned.
This parameter can be specified multiple times, and/or be a comma-separated list.
Specifiying a project that does not exist (or that you cannot create issues in) is not an error, but it will not be in the results.issuetypeIds
- combinded with issuetypeNames, lists the issue types with which to filter the results. If null, all issue types are returned.
This parameter can be specified multiple times, and/or be a comma-separated list.
Specifiying an issue type that does not exist is not an error.issuetypeNames
- combinded with issuetypeIds, lists the issue types with which to filter the results. If null, all issue types are returned.
This parameter can be specified multiple times, but is NOT interpreted as a comma-separated list.
Specifiying an issue type that does not exist is not an error.public javax.ws.rs.core.Response getCreateIssueMetaProjectIssueTypes(String projectIdOrKey, long startAt, int maxResults)
public javax.ws.rs.core.Response getCreateIssueMetaFields(String projectIdOrKey, String issueTypeId, long startAt, int maxResults)
public javax.ws.rs.core.Response getEditIssueMeta(String issueIdOrKey)
issueIdOrKey
- the issue whose edit meta data you want to viewpublic javax.ws.rs.core.Response editIssue(String issueIdOrKey, boolean notifyUsers, IssueUpdateBean updateRequest)
issueIdOrKey
- the issue id or key to update (i.e. JRA-1330)notifyUsers
- send the email with notification that the issue was updated to users that watch it.
Admin or project admin permissions are required to disable the notification.public javax.ws.rs.core.Response assign(String issueIdOrKey, UserBean assigneeBean)
issueIdOrKey
- a String containing an issue keyassigneeBean
- A UserBean with the name of the user to assign the issue to.public javax.ws.rs.core.Response getRemoteIssueLinks(String issueIdOrKey, String globalId)
issueIdOrKey
- the issue to view the remote issue links forglobalId
- The id of the remote issue link to be returned. If null (not provided) all remote links for the
issue are returned.
For a fullexplanation of Issue Link fields please refer to https://developer.atlassian.com/display/JIRADEV/Fields+in+Remote+Issue+Links
public javax.ws.rs.core.Response getRemoteIssueLinkById(String issueIdOrKey, String linkId)
issueIdOrKey
- the issue to view the remote issue links forlinkId
- the id of the remote issue linkpublic javax.ws.rs.core.Response createOrUpdateRemoteIssueLink(String issueIdOrKey, RemoteIssueLinkCreateOrUpdateRequest request)
issueIdOrKey
- the issue to create the remote issue link forrequest
- a request to create or update a remote issue linkpublic javax.ws.rs.core.Response updateRemoteIssueLink(String issueIdOrKey, String linkId, RemoteIssueLinkCreateOrUpdateRequest updateRequest)
issueIdOrKey
- the issue to update the remote issue link forupdateRequest
- a request to update a remote issue linkpublic javax.ws.rs.core.Response deleteRemoteIssueLinkById(String issueIdOrKey, String remoteIssueLinkId)
issueIdOrKey
- the issue to create the remote issue link forremoteIssueLinkId
- the id of the remote issue linkpublic javax.ws.rs.core.Response deleteRemoteIssueLinkByGlobalId(String issueIdOrKey, String globalId)
issueIdOrKey
- the issue to create the remote issue link forglobalId
- the global id of the remote issue linkpublic javax.ws.rs.core.Response getIssueWorklog(String issueIdOrKey)
issueIdOrKey
- the worklogs belongs topublic javax.ws.rs.core.Response getWorklog(String issueIdOrKey, String worklogId)
issueIdOrKey
- a string containing the issue id or key the worklog belongs toworklogId
- a String containing the work log idpublic javax.ws.rs.core.Response updateWorklog(String issueIdOrKey, String worklogId, String adjustEstimate, String newEstimate, WorklogJsonBean request)
Note that:
issueIdOrKey
- a string containing the issue id or key the worklog belongs toworklogId
- id of the worklog to be updatedadjustEstimate
- (optional) allows you to provide specific instructions to update the remaining time estimate of the issue. Valid values are
newEstimate
- (required when "new" is selected for adjustEstimate) the new value for the remaining estimate field.public javax.ws.rs.core.Response deleteWorklog(String issueIdOrKey, String worklogId, String adjustEstimate, String newEstimate, String increaseBy)
issueIdOrKey
- a string containing the issue id or key the worklog belongs toworklogId
- id of the worklog to be deletedadjustEstimate
- (optional) allows you to provide specific instructions to update the remaining time estimate of the issue. Valid values are
newEstimate
- (required when "new" is selected for adjustEstimate) the new value for the remaining estimate field. e.g. "2d"increaseBy
- (required when "manual" is selected for adjustEstimate) the amount to increase the remaining estimate by e.g. "2d"public javax.ws.rs.core.Response addWorklog(String issueIdOrKey, String adjustEstimate, String newEstimate, String reduceBy, WorklogJsonBean request)
issueIdOrKey
- a string containing the issue id or key the worklog will be added toadjustEstimate
- (optional) allows you to provide specific instructions to update the remaining time estimate of the issue. Valid values are
newEstimate
- (required when "new" is selected for adjustEstimate) the new value for the remaining estimate field. e.g. "2d"reduceBy
- (required when "manual" is selected for adjustEstimate) the amount to reduce the remaining estimate by e.g. "2d"request
- json body of request converted to a WorklogJsonBean
public javax.ws.rs.core.Response getComments(String issueIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand)
Results can be ordered by the "created" field which means the date a comment was added.
issueIdOrKey
- to get comments forstartAt
- the page offset, if not specified then defaults to 0maxResults
- how many results on the page should be included. Defaults to 50.orderBy
- ordering of the results.expand
- optional flags: renderedBody (provides body rendered in HTML)public javax.ws.rs.core.Response getComment(String issueIdOrKey, String commentId, String expand)
commentId
- the ID of the comment to requestissueIdOrKey
- of the issue the comment belongs toexpand
- optional flags: renderedBody (provides body rendered in HTML)public javax.ws.rs.core.Response updateComment(String issueIdOrKey, String commentId, String expand, CommentJsonBean request)
issueIdOrKey
- a string containing the issue id or key the comment belongs tocommentId
- id of the comment to be updatedexpand
- optional flags: renderedBody (provides body rendered in HTML)request
- json body of request converted to a CommentJsonBean
public javax.ws.rs.core.Response deleteComment(String issueIdOrKey, String commentId)
issueIdOrKey
- a string containing the issue id or key the comment belongs tocommentId
- id of the comment to be deletedpublic javax.ws.rs.core.Response addComment(String issueIdOrKey, String expand, CommentJsonBean request)
issueIdOrKey
- a string containing the issue id or key the comment will be added toexpand
- optional flags: renderedBody (provides body rendered in HTML)request
- json body of request converted to a CommentJsonBean
public javax.ws.rs.core.Response notify(String issueIdOrKey, NotificationJsonBean request)
issueIdOrKey
- a string containing the issue id or key the comment will be added torequest
- json body of request converted to a NotificationJsonBean
protected javax.ws.rs.core.Response BAD_REQUEST()
protected static javax.ws.rs.core.Response NO_CONTENT()
public Collection<FieldMetaBean> getRequiredFields(FieldScreenRenderer fieldScreenRenderer, Issue issue)
Copyright © 2002-2021 Atlassian. All Rights Reserved.