com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client
Class IssueClient

java.lang.Object
  extended by com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient<IssueClient>
      extended by com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.IssueClient

public class IssueClient
extends RestApiClient<IssueClient>

Client for the issue resource.

Since:
v4.3

Nested Class Summary
 
Nested classes/interfaces inherited from class com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient
RestApiClient.Method
 
Field Summary
 
Fields inherited from class com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient
REST_VERSION
 
Constructor Summary
IssueClient(JIRAEnvironmentData environmentData)
          Constructs a new IssueClient for a JIRA instance.
 
Method Summary
 Response assign(String issueKey, User assignee)
          GETs the issue with the given key.
 IssueCreateResponse create(IssueUpdateRequest issue)
           
 RemoteIssueLinkCreateOrUpdateResponse createOrUpdateRemoteIssueLink(String issueKey, RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
          Create a remote link.
 com.sun.jersey.api.client.ClientResponse createOrUpdateRemoteIssueLinkAndGetClientResponse(String issueKey, RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
          Create a remote link, and return a ClientResponse.
 Response createOrUpdateRemoteIssueLinkAndGetResponse(String issueKey, RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
          Create a remote link, and return a Response.
protected  com.sun.jersey.api.client.WebResource createResource()
          Creates the resource that corresponds to the root of the REST API.
 Response delete(String issueKey, String deleteSubtasks)
          GETs the issue with the given key.
 Response deleteRemoteIssueLink(String issueKey, String remoteIssueLinkId)
          Delete a remote link, and return a Response.
 Response deleteRemoteIssueLinkByGlobalId(String issueKey, String globalId)
          Delete a remote link by global id, and return a Response.
 void edit(String issueKey, IssueUpdateRequest updateRequest)
           
 Issue get(String issueKey, Issue.Expand... expand)
          GETs the issue with the given key.
 IssueCreateMeta getCreateMeta(List<StringList> projectIds, List<StringList> projectKeys, List<StringList> issueTypeIds, List<String> issueTypeNames, IssueCreateMeta.Expand... expand)
          Returns the meta data for creating issues.
 Response getCreateMetaResponse(List<StringList> projectIds, List<StringList> projectKeys, List<StringList> issueTypeIds, List<String> issueTypeNames, IssueCreateMeta.Expand... expand)
          Gets the meta data for creating issues, returning a Response.
 Issue getFromURL(String issueURL, Issue.Expand... expand)
          GETs the issue from the given URL.
 Issue getPartially(String issueKey, EnumSet<Issue.Expand> expand, StringList... fields)
           
 Issue getPartially(String issueKey, StringList... fields)
          GETs the issue with the given key, returning only the request fields.
 RemoteIssueLink getRemoteIssueLink(String issueKey, String remoteIssueLinkId)
          Returns a remote link.
 RemoteIssueLink getRemoteIssueLinkByGlobalId(String issueKey, String globalId)
          Returns the remote link for an issue with the given globalId.
 Response getRemoteIssueLinkResponse(String issueKey, String remoteIssueLinkId)
          Gets a remote link, returning a Response.
 List<RemoteIssueLink> getRemoteIssueLinks(String issueKey)
          Returns the remote links for an issue.
 Response getRemoteIssueLinksResponse(String issueKey)
          Gets the remote links for an issue, returning a Response.
 Response getRemoteIssueLinksResponse(String issueKey, Map<String,String> queryParams)
           
 Response getResponse(IssueUpdateRequest issue)
          Creates an issue as per the request, and returns the Response.
 Response getResponse(String issueKey)
          GETs the issue with the given key, returning a Response.
 com.sun.jersey.api.client.WebResource issueResource(String issueKey, Issue.Expand... expand)
           
protected  com.sun.jersey.api.client.WebResource issueWithKey(String issueKey, List<StringList> fields, EnumSet<Issue.Expand> expand)
          Returns a WebResource for the issue with the given key.
 void operationalUpdate(String issueKey, OperationalUpdateRequest updateRequest)
           
 Response operationalUpdateResponse(String issueKey, OperationalUpdateRequest update)
           
 void update(String issueKey, IssueUpdateRequest issue)
           
 Response update(String issueKey, Map update)
           
 Response updateRemoteIssueLink(String issueKey, String linkId, RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
          Update a remote link, and return a Response.
 Response updateResponse(String issueKey, IssueUpdateRequest update)
           
 
Methods inherited from class com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.RestApiClient
anonymous, errorResponse, expanded, loginAs, loginAs, percentEncode, resourceRoot, setOf, toResponse, toResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IssueClient

public IssueClient(JIRAEnvironmentData environmentData)
Constructs a new IssueClient for a JIRA instance.

Parameters:
environmentData - The JIRA environment data
Method Detail

get

public Issue get(String issueKey,
                 Issue.Expand... expand)
          throws com.sun.jersey.api.client.UniformInterfaceException
GETs the issue with the given key.

Parameters:
issueKey - a String containing an issue key
expand - the attributes to expand
Returns:
an Issue
Throws:
com.sun.jersey.api.client.UniformInterfaceException - if there's a problem getting the issue

issueResource

public com.sun.jersey.api.client.WebResource issueResource(String issueKey,
                                                           Issue.Expand... expand)

getPartially

public Issue getPartially(String issueKey,
                          StringList... fields)
                   throws com.sun.jersey.api.client.UniformInterfaceException
GETs the issue with the given key, returning only the request fields.

Parameters:
issueKey - a String containing an issue key
fields - the list of fields to return for the issue
Returns:
an Issue
Throws:
com.sun.jersey.api.client.UniformInterfaceException - if there's a problem getting the issue

getPartially

public Issue getPartially(String issueKey,
                          EnumSet<Issue.Expand> expand,
                          StringList... fields)
                   throws com.sun.jersey.api.client.UniformInterfaceException
Throws:
com.sun.jersey.api.client.UniformInterfaceException

getFromURL

public Issue getFromURL(String issueURL,
                        Issue.Expand... expand)
                 throws com.sun.jersey.api.client.UniformInterfaceException
GETs the issue from the given URL.

Parameters:
issueURL - a String containing the valid URL for an issue
expand - the attributes to expand
Returns:
an Issue
Throws:
com.sun.jersey.api.client.UniformInterfaceException - if there's a problem getting the issue

create

public IssueCreateResponse create(IssueUpdateRequest issue)

edit

public void edit(String issueKey,
                 IssueUpdateRequest updateRequest)

getResponse

public Response getResponse(IssueUpdateRequest issue)
Creates an issue as per the request, and returns the Response.

Parameters:
issue - an IssueCreateRequest
Returns:
a Response

operationalUpdateResponse

public Response operationalUpdateResponse(String issueKey,
                                          OperationalUpdateRequest update)

operationalUpdate

public void operationalUpdate(String issueKey,
                              OperationalUpdateRequest updateRequest)

update

public void update(String issueKey,
                   IssueUpdateRequest issue)

updateResponse

public Response updateResponse(String issueKey,
                               IssueUpdateRequest update)

update

public Response update(String issueKey,
                       Map update)

delete

public Response delete(String issueKey,
                       String deleteSubtasks)
                throws com.sun.jersey.api.client.UniformInterfaceException
GETs the issue with the given key.

Parameters:
issueKey - a String containing an issue key or id
deleteSubtasks - the attributes to expand
Returns:
a Response
Throws:
com.sun.jersey.api.client.UniformInterfaceException - if there's a problem deleting the issue

assign

public Response assign(String issueKey,
                       User assignee)
                throws com.sun.jersey.api.client.UniformInterfaceException
GETs the issue with the given key.

Parameters:
issueKey - a String containing an issue key or id
assignee - user object
Returns:
a Response
Throws:
com.sun.jersey.api.client.UniformInterfaceException - if there's a problem deleting the issue

getResponse

public Response getResponse(String issueKey)
GETs the issue with the given key, returning a Response.

Parameters:
issueKey - a String containing an issue key
Returns:
a Response

issueWithKey

protected com.sun.jersey.api.client.WebResource issueWithKey(String issueKey,
                                                             @Nullable
                                                             List<StringList> fields,
                                                             EnumSet<Issue.Expand> expand)
Returns a WebResource for the issue with the given key.

Parameters:
issueKey - a String containing an issue key
fields - the list of fields to return for the issue
expand - what to expand
Returns:
a WebResource

getCreateMeta

public IssueCreateMeta getCreateMeta(@Nullable
                                     List<StringList> projectIds,
                                     @Nullable
                                     List<StringList> projectKeys,
                                     @Nullable
                                     List<StringList> issueTypeIds,
                                     @Nullable
                                     List<String> issueTypeNames,
                                     IssueCreateMeta.Expand... expand)
Returns the meta data for creating issues.

Parameters:
projectIds - the list of projects to filter on
projectKeys - the list of projects to filter on
issueTypeIds - the list of issue types to filter on
expand - what to expand
Returns:
an IssueCreateMeta

getCreateMetaResponse

public Response getCreateMetaResponse(@Nullable
                                      List<StringList> projectIds,
                                      @Nullable
                                      List<StringList> projectKeys,
                                      @Nullable
                                      List<StringList> issueTypeIds,
                                      @Nullable
                                      List<String> issueTypeNames,
                                      IssueCreateMeta.Expand... expand)
Gets the meta data for creating issues, returning a Response.

Parameters:
projectIds - the list of projects to filter on
projectKeys - the list of projects to filter on
issueTypeIds - the list of issue types to filter on
expand - what to expand
Returns:
a Response

createOrUpdateRemoteIssueLink

public RemoteIssueLinkCreateOrUpdateResponse createOrUpdateRemoteIssueLink(String issueKey,
                                                                           RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
Create a remote link.

Parameters:
issueKey -
remoteIssueLink -
Returns:
a RemoteIssueLinkCreateOrUpdateResponse

createOrUpdateRemoteIssueLinkAndGetResponse

public Response createOrUpdateRemoteIssueLinkAndGetResponse(String issueKey,
                                                            RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
Create a remote link, and return a Response. This is useful for checking error conditions.

Parameters:
issueKey -
remoteIssueLink -
Returns:
a Response

createOrUpdateRemoteIssueLinkAndGetClientResponse

public com.sun.jersey.api.client.ClientResponse createOrUpdateRemoteIssueLinkAndGetClientResponse(String issueKey,
                                                                                                  RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
Create a remote link, and return a ClientResponse.

Parameters:
issueKey -
remoteIssueLink -
Returns:
a Response

updateRemoteIssueLink

public Response updateRemoteIssueLink(String issueKey,
                                      String linkId,
                                      RemoteIssueLinkCreateOrUpdateRequest remoteIssueLink)
Update a remote link, and return a Response. This is useful for checking error conditions.

Parameters:
issueKey -
remoteIssueLink -
Returns:
a Response

deleteRemoteIssueLink

public Response deleteRemoteIssueLink(String issueKey,
                                      String remoteIssueLinkId)
Delete a remote link, and return a Response.

Parameters:
issueKey -
remoteIssueLinkId -
Returns:
a Response

deleteRemoteIssueLinkByGlobalId

public Response deleteRemoteIssueLinkByGlobalId(String issueKey,
                                                String globalId)
Delete a remote link by global id, and return a Response.

Parameters:
issueKey -
globalId -
Returns:
a Response

getRemoteIssueLink

public RemoteIssueLink getRemoteIssueLink(String issueKey,
                                          String remoteIssueLinkId)
Returns a remote link.

Parameters:
issueKey -
remoteIssueLinkId -
Returns:
a RemoteIssueLink

getRemoteIssueLinks

public List<RemoteIssueLink> getRemoteIssueLinks(String issueKey)
Returns the remote links for an issue.

Parameters:
issueKey -
Returns:
a List of RemoteIssueLinks

getRemoteIssueLinkByGlobalId

public RemoteIssueLink getRemoteIssueLinkByGlobalId(String issueKey,
                                                    String globalId)
Returns the remote link for an issue with the given globalId.

Parameters:
issueKey -
globalId -
Returns:
a RemoteIssueLink

getRemoteIssueLinkResponse

public Response getRemoteIssueLinkResponse(String issueKey,
                                           String remoteIssueLinkId)
Gets a remote link, returning a Response.

Parameters:
issueKey -
remoteIssueLinkId -
Returns:
a Response

getRemoteIssueLinksResponse

public Response getRemoteIssueLinksResponse(String issueKey)
Gets the remote links for an issue, returning a Response.

Parameters:
issueKey -
Returns:
a Response

getRemoteIssueLinksResponse

public Response getRemoteIssueLinksResponse(String issueKey,
                                            @Nullable
                                            Map<String,String> queryParams)

createResource

protected com.sun.jersey.api.client.WebResource createResource()
Description copied from class: RestApiClient
Creates the resource that corresponds to the root of the REST API.

Overrides:
createResource in class RestApiClient<IssueClient>
Returns:
a WebResource for the REST API root


Copyright © 2002-2012 Atlassian. All Rights Reserved.