Package com.atlassian.jira.rest.v2.issue
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProjectResource
(ProjectService projectService, JiraAuthenticationContext authContext, javax.ws.rs.core.UriInfo uriInfo, VersionService versionService, ProjectComponentService projectComponentService, AvatarService avatarService, UserManager userManager, ProjectBeanFactory projectBeanFactory, VersionBeanFactory versionBeanFactory, PermissionManager permissionManager, ProjectManager projectManager, AvatarManager avatarManager, AvatarPickerHelper avatarPickerHelper, AttachmentHelper attachmentHelper, JiraBaseUrls jiraBaseUrls, WorkflowManager workflowManager, IssueTypeSchemeManager issueTypeSchemeManager, PermissionSchemeManager permissionSchemeManager, NotificationSchemeManager notificationSchemeManager, IssueSecuritySchemeManager issueSecuritySchemeManager, ResourceUriBuilder uriBuilder, StatusHelper statusHelper, ProjectFinder projectFinder, XsrfInvocationChecker xsrfChecker, UserProjectHistoryManager projectHistoryManager, ResponseFactory responses, I18nHelper i18nHelper, com.atlassian.jira.blueprint.core.api.CoreProjectConfigurator coreProjectConfigurator, ArchivedProjectService archivedProjectService, OrderByRequestParser orderByRequestParser, com.atlassian.jira.rest.v2.issue.ProjectWorkflowSchemeAssignor projectWorkflowSchemeAssignor, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
archiveProject
(String projectIdOrKey) Archives a project.javax.ws.rs.core.Response
createAvatarFromTemporary
(String projectIdOrKey, AvatarCroppingBean croppingInstructions) Converts the temporary avatar into the final one.javax.ws.rs.core.Response
createProject
(ProjectInputBean project) Creates a new project.javax.ws.rs.core.Response
deleteAvatar
(String projectIdOrKey, Long id) Deletes avatarjavax.ws.rs.core.Response
deleteProject
(String projectIdOrKey) Deletes a project.javax.ws.rs.core.Response
getAllAvatars
(String projectIdOrKey) Returns all avatars which are visible for the currently logged in user.javax.ws.rs.core.Response
getAllProjects
(String expand, Integer recent, boolean includeArchived, boolean browseArchive) Returns all projects which are visible for the currently logged in user.javax.ws.rs.core.Response
getAllStatuses
(String projectIdOrKey) Get all issue types with valid status values for a projectjavax.ws.rs.core.Response
getProject
(String projectIdOrKey, String expand) Contains a full representation of a project in JSON format.javax.ws.rs.core.Response
getProjectComponents
(String projectIdOrKey) Contains a full representation of the specified project's components.javax.ws.rs.core.Response
getProjectVersions
(String projectIdOrKey, String expand) Contains a full representation of a the specified project's versions.javax.ws.rs.core.Response
getProjectVersionsPaginated
(String projectIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand) Returns all versions for the specified project.javax.ws.rs.core.Response
restoreProject
(String projectIdOrKey) Restore an archived project.javax.ws.rs.core.Response
storeTemporaryAvatar
(String projectIdOrKey, String filename, Long size, javax.servlet.http.HttpServletRequest request) Uploads an image and creates a temporary avatar.javax.ws.rs.core.Response
storeTemporaryAvatarUsingMultiPart
(String projectIdOrKey, com.atlassian.plugins.rest.api.multipart.FilePart filePart, javax.servlet.http.HttpServletRequest request) Creates temporary avatar using multipart.javax.ws.rs.core.Response
updateProject
(String projectIdOrKey, String expand, ProjectUpdateBean updateData) Updates a project.javax.ws.rs.core.Response
updateProjectAvatar
(String projectIdOrKey, AvatarBean avatarBean) Updates an avatar for a project.javax.ws.rs.core.Response
updateProjectType
(String projectIdOrKey, String newProjectTypeKey) Updates the type of a project.
-
Field Details
-
MAX_RECENT_PROJECTS
public static final int MAX_RECENT_PROJECTS- See Also:
-
-
Constructor Details
-
ProjectResource
@Inject public ProjectResource(ProjectService projectService, JiraAuthenticationContext authContext, javax.ws.rs.core.UriInfo uriInfo, VersionService versionService, ProjectComponentService projectComponentService, AvatarService avatarService, UserManager userManager, ProjectBeanFactory projectBeanFactory, VersionBeanFactory versionBeanFactory, PermissionManager permissionManager, ProjectManager projectManager, AvatarManager avatarManager, AvatarPickerHelper avatarPickerHelper, AttachmentHelper attachmentHelper, JiraBaseUrls jiraBaseUrls, WorkflowManager workflowManager, IssueTypeSchemeManager issueTypeSchemeManager, PermissionSchemeManager permissionSchemeManager, NotificationSchemeManager notificationSchemeManager, IssueSecuritySchemeManager issueSecuritySchemeManager, ResourceUriBuilder uriBuilder, StatusHelper statusHelper, ProjectFinder projectFinder, XsrfInvocationChecker xsrfChecker, UserProjectHistoryManager projectHistoryManager, ResponseFactory responses, I18nHelper i18nHelper, com.atlassian.jira.blueprint.core.api.CoreProjectConfigurator coreProjectConfigurator, ArchivedProjectService archivedProjectService, OrderByRequestParser orderByRequestParser, com.atlassian.jira.rest.v2.issue.ProjectWorkflowSchemeAssignor projectWorkflowSchemeAssignor, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
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 keyexpand
- the parameters to expand- Returns:
- a project
-
createProject
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 updateexpand
- the parameters to expand in returned projectupdateData
- 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 updatenewProjectTypeKey
- 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 keyexpand
- 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 keystartAt
- 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
- 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 expandrecent
- 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: falsebrowseArchive
- 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 keycroppingInstructions
- 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 keyavatarBean
- 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 keyfilename
- name of file being uploadedsize
- size of the image filerequest
- 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 keyrequest
- 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 keyid
- 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
-