Class ProjectResource

java.lang.Object
com.atlassian.jira.rest.v2.issue.ProjectResource

@Path("project") @Consumes("application/json") @Produces("application/json") public class ProjectResource extends Object
Since:
4.2
  • Field Details

  • Constructor Details

  • Method Details

    • getProject

      @GET @Path("{projectIdOrKey}") public javax.ws.rs.core.Response getProject(@PathParam("projectIdOrKey") String projectIdOrKey, @QueryParam("expand") String expand)
      Contains a full representation of a project in JSON format.

      All project keys associated with the project will only be returned if expand=projectKeys.

      Parameters:
      projectIdOrKey - the project id or project key
      expand - the parameters to expand
      Returns:
      a project
    • createProject

      @POST public javax.ws.rs.core.Response createProject(ProjectInputBean project)
      Creates a new project.
      Parameters:
      project - new project details
      Returns:
      The ProjectIdentity of newly created project.
    • updateProject

      @PUT @Path("{projectIdOrKey}") public javax.ws.rs.core.Response updateProject(@PathParam("projectIdOrKey") String projectIdOrKey, @QueryParam("expand") String expand, ProjectUpdateBean updateData)
      Updates a project.

      Only non null values sent in JSON will be updated in the project.

      Values available for the assigneeType field are: "PROJECT_LEAD" and "UNASSIGNED".

      Parameters:
      projectIdOrKey - identity of the project to update
      expand - the parameters to expand in returned project
      updateData - new values for the project
      Returns:
      updated project details.
    • updateProjectType

      @PUT @Path("{projectIdOrKey}/type/{newProjectTypeKey}") public javax.ws.rs.core.Response updateProjectType(@PathParam("projectIdOrKey") String projectIdOrKey, @PathParam("newProjectTypeKey") String newProjectTypeKey)
      Updates the type of a project.
      Parameters:
      projectIdOrKey - identity of the project to update
      newProjectTypeKey - The key of the new project type
      Returns:
      A response that will contain the updated project if the operation was successful.
    • archiveProject

      @PUT @Path("{projectIdOrKey}/archive") public javax.ws.rs.core.Response archiveProject(@PathParam("projectIdOrKey") String projectIdOrKey)
      Archives a project.
      Parameters:
      projectIdOrKey - Project id or project key
      Returns:
      no content response
    • restoreProject

      @PUT @Path("{projectIdOrKey}/restore") public javax.ws.rs.core.Response restoreProject(@PathParam("projectIdOrKey") String projectIdOrKey)
      Restore an archived project. In case of success restored project should be re-indexed.
      Parameters:
      projectIdOrKey - Project id or project key
      Returns:
      no content response
    • deleteProject

      @DELETE @Path("{projectIdOrKey}") public javax.ws.rs.core.Response deleteProject(@PathParam("projectIdOrKey") String projectIdOrKey)
      Deletes a project.
      Parameters:
      projectIdOrKey - Project id or project key
      Returns:
      no content response
    • getProjectVersions

      @GET @Path("{projectIdOrKey}/versions") public javax.ws.rs.core.Response getProjectVersions(@PathParam("projectIdOrKey") String projectIdOrKey, @QueryParam("expand") String expand)
      Contains a full representation of a the specified project's versions.
      Parameters:
      projectIdOrKey - the project id or project key
      expand - the parameters to expand
      Returns:
      the passed project's versions.
    • getProjectVersionsPaginated

      @GET @Path("{projectIdOrKey}/version") public javax.ws.rs.core.Response getProjectVersionsPaginated(@PathParam("projectIdOrKey") String projectIdOrKey, @QueryParam("startAt") Long startAt, @QueryParam("maxResults") Integer maxResults, @QueryParam("orderBy") String orderBy, @QueryParam("expand") String expand)
      Returns all versions for the specified project.
      Parameters:
      projectIdOrKey - the project id or project key
      startAt - the page offset, if not specified then defaults to 0
      maxResults - how many results on the page should be included. Defaults to 50.
      orderBy - ordering of the results.
      expand - the parameters to expand
      Returns:
      the passed project's versions.
    • getProjectComponents

      @GET @Path("{projectIdOrKey}/components") public javax.ws.rs.core.Response getProjectComponents(@PathParam("projectIdOrKey") String projectIdOrKey)
      Contains a full representation of the specified project's components.
      Parameters:
      projectIdOrKey - the project id or project key
      Returns:
      the passed project's components.
    • getAllProjects

      @GET public javax.ws.rs.core.Response getAllProjects(@QueryParam("expand") String expand, @QueryParam("recent") Integer recent, @QueryParam("includeArchived") boolean includeArchived, @QueryParam("browseArchive") boolean browseArchive)
      Returns all projects which are visible for the currently logged in user. If no user is logged in, it returns the list of projects that are visible when using anonymous access.
      Parameters:
      expand - the parameters to expand
      recent - if this parameter is set then only projects recently accessed by the current user (if not logged in then based on HTTP session) will be returned (maximum count limited to the specified number but no more than 20).
      includeArchived - whether to include archived projects in response, default: false
      browseArchive - whether to include only projects where current user can browse archive
      Returns:
      all projects for which the user has the BROWSE project permission. If no user is logged in, it returns all projects, which are visible when using anonymous access.
      Since:
      v4.3
    • getAllAvatars

      @GET @Path("{projectIdOrKey}/avatars") public javax.ws.rs.core.Response getAllAvatars(@PathParam("projectIdOrKey") String projectIdOrKey)
      Returns all avatars which are visible for the currently logged in user. The avatars are grouped into system and custom.
      Parameters:
      projectIdOrKey - project id or project key
      Returns:
      all avatars for which the user has the BROWSE project permission.
      Since:
      v5.0
    • createAvatarFromTemporary

      @POST @Path("{projectIdOrKey}/avatar") public javax.ws.rs.core.Response createAvatarFromTemporary(@PathParam("projectIdOrKey") String projectIdOrKey, AvatarCroppingBean croppingInstructions)
      Converts the temporary avatar into the final one. This is step 2/3 of changing an avatar for a project.
      Parameters:
      projectIdOrKey - project id or project key
      croppingInstructions - cropping instructions
      Returns:
      created avatar
    • updateProjectAvatar

      @PUT @Path("{projectIdOrKey}/avatar") public javax.ws.rs.core.Response updateProjectAvatar(@PathParam("projectIdOrKey") String projectIdOrKey, AvatarBean avatarBean)
      Updates an avatar for a project. This is step 3/3 of changing an avatar for a project:
      • Upload (store temporary avatar)
      • Crop (create avatar from temporary)
      • Update (update project avatar)
      Parameters:
      projectIdOrKey - project id or project key
      avatarBean - avatar data returned in step 2
      Returns:
      avatar update status
    • storeTemporaryAvatar

      @POST @Consumes("*/*") @Path("{projectIdOrKey}/avatar/temporary") public javax.ws.rs.core.Response storeTemporaryAvatar(@PathParam("projectIdOrKey") String projectIdOrKey, @QueryParam("filename") String filename, @QueryParam("size") Long size, @Context javax.servlet.http.HttpServletRequest request)
      Uploads an image and creates a temporary avatar. This is step 1/3 of changing an avatar for a project
      Parameters:
      projectIdOrKey - Project id or project key
      filename - name of file being uploaded
      size - size of the image file
      request - servlet request
      Returns:
      temporary avatar cropping instructions
      Since:
      v5.0
    • storeTemporaryAvatarUsingMultiPart

      @POST @Consumes("multipart/form-data") @Path("{projectIdOrKey}/avatar/temporary") @Produces("text/html") public javax.ws.rs.core.Response storeTemporaryAvatarUsingMultiPart(@PathParam("projectIdOrKey") String projectIdOrKey, com.atlassian.plugins.rest.api.multipart.FilePart filePart, @Context javax.servlet.http.HttpServletRequest request)
      Creates temporary avatar using multipart. The response is sent back as JSON stored in a textarea. This is because the client uses remote iframing to submit avatars using multipart. So we must send them a valid HTML page back from which the client parses the JSON.
      Parameters:
      projectIdOrKey - Project id or project key
      request - servlet request
      Returns:
      temporary avatar cropping instructions
      Since:
      v5.0
    • deleteAvatar

      @DELETE @Path("{projectIdOrKey}/avatar/{id}") public javax.ws.rs.core.Response deleteAvatar(@PathParam("projectIdOrKey") String projectIdOrKey, @PathParam("id") Long id)
      Deletes avatar
      Parameters:
      projectIdOrKey - Project id or project key
      id - database id for avatar
      Returns:
      no content response
      Since:
      v5.0
    • getAllStatuses

      @GET @Path("{projectIdOrKey}/statuses") public javax.ws.rs.core.Response getAllStatuses(@PathParam("projectIdOrKey") String projectIdOrKey)
      Get all issue types with valid status values for a project
      Parameters:
      projectIdOrKey - Project id or project key
      Returns:
      collection of issue types with possible status values
      Since:
      v6.0