public class ProjectResource extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_RECENT_PROJECTS |
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
javax.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 avatar
|
javax.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 project
|
javax.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 a 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.common.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.
|
public static final int MAX_RECENT_PROJECTS
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)
public javax.ws.rs.core.Response getProject(String projectIdOrKey, String expand)
All project keys associated with the project will only be returned if expand=projectKeys
.
projectIdOrKey
- the project id or project keyexpand
- the parameters to expandpublic javax.ws.rs.core.Response createProject(ProjectInputBean project)
project
- new project detailsProjectIdentity
of newly created project.public javax.ws.rs.core.Response updateProject(String projectIdOrKey, String expand, ProjectUpdateBean updateData)
Only non null values sent in JSON will be updated in the project.
Values available for the assigneeType field are: "PROJECT_LEAD" and "UNASSIGNED".
projectIdOrKey
- identity of the project to updateexpand
- the parameters to expand in returned projectupdateData
- new values for the projectpublic javax.ws.rs.core.Response updateProjectType(String projectIdOrKey, String newProjectTypeKey)
projectIdOrKey
- identity of the project to updatenewProjectTypeKey
- The key of the new project typepublic javax.ws.rs.core.Response archiveProject(String projectIdOrKey)
projectIdOrKey
- Project id or project keypublic javax.ws.rs.core.Response restoreProject(String projectIdOrKey)
projectIdOrKey
- Project id or project keypublic javax.ws.rs.core.Response deleteProject(String projectIdOrKey)
projectIdOrKey
- Project id or project keypublic javax.ws.rs.core.Response getProjectVersions(String projectIdOrKey, String expand)
projectIdOrKey
- the project id or project keyexpand
- the parameters to expandpublic javax.ws.rs.core.Response getProjectVersionsPaginated(String projectIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand)
Results can be ordered by the following fields:
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 expandpublic javax.ws.rs.core.Response getProjectComponents(String projectIdOrKey)
projectIdOrKey
- the project id or project keypublic javax.ws.rs.core.Response getAllProjects(String expand, Integer recent, boolean includeArchived, boolean browseArchive)
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 archivepublic javax.ws.rs.core.Response getAllAvatars(String projectIdOrKey)
projectIdOrKey
- project id or project keypublic javax.ws.rs.core.Response createAvatarFromTemporary(String projectIdOrKey, AvatarCroppingBean croppingInstructions)
projectIdOrKey
- project id or project keycroppingInstructions
- cropping instructionspublic javax.ws.rs.core.Response updateProjectAvatar(String projectIdOrKey, AvatarBean avatarBean)
projectIdOrKey
- project id or project keyavatarBean
- avatar data returned in step 2public javax.ws.rs.core.Response storeTemporaryAvatar(String projectIdOrKey, String filename, Long size, @Context javax.servlet.http.HttpServletRequest request)
curl \ -X POST \ -u admin:admin \ -H "X-Atlassian-Token: no-check" \ -H "Content-Type: image/png" \ --data-binary @mynewavatar.png \ 'http://localhost:8090/jira/rest/api/2/user/avatar/temporary?username=admin&filename=mynewavatar.png'
projectIdOrKey
- Project id or project keyfilename
- name of file being uploadedsize
- size of the image filerequest
- servlet requestpublic javax.ws.rs.core.Response storeTemporaryAvatarUsingMultiPart(String projectIdOrKey, com.atlassian.plugins.rest.common.multipart.FilePart filePart, @Context javax.servlet.http.HttpServletRequest request)
projectIdOrKey
- Project id or project keyrequest
- servlet requestpublic javax.ws.rs.core.Response deleteAvatar(String projectIdOrKey, Long id)
projectIdOrKey
- Project id or project keyid
- database id for avatarpublic javax.ws.rs.core.Response getAllStatuses(String projectIdOrKey)
projectIdOrKey
- Project id or project keyCopyright © 2002-2023 Atlassian. All Rights Reserved.