public class

ProjectResource

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

Summary

Constants
int MAX_RECENT_PROJECTS
Public Constructors
ProjectResource(ProjectService projectService, JiraAuthenticationContext authContext, 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, CoreProjectConfigurator coreProjectConfigurator, JiraAvatarSupport jiraAvatarSupport, OrderByRequestParser orderByRequestParser)
Public Methods
Response createAvatarFromTemporary(String projectIdOrKey, AvatarCroppingBean croppingInstructions)
Converts temporary avatar into a real avatar
Response createProject(ProjectInputBean project)
Creates a new project.
Response deleteAvatar(String projectIdOrKey, Long id)
Deletes avatar
Response deleteProject(String projectIdOrKey)
Deletes a project.
Response getAllAvatars(String projectIdOrKey)
Returns all avatars which are visible for the currently logged in user.
Response getAllProjects(String expand, Integer recent)
Returns all projects which are visible for the currently logged in user.
Response getAllStatuses(String projectIdOrKey)
Get all issue types with valid status values for a project
Response getProject(String projectIdOrKey, String expand)
Contains a full representation of a project in JSON format.
Response getProjectComponents(String projectIdOrKey)
Contains a full representation of a the specified project's components.
Response getProjectVersions(String projectIdOrKey, String expand)
Contains a full representation of a the specified project's versions.
Response getProjectVersionsPaginated(String projectIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand)
Returns all versions for the specified project.
Response storeTemporaryAvatar(String projectIdOrKey, String filename, Long size, HttpServletRequest request)
Creates temporary avatar
Response storeTemporaryAvatarUsingMultiPart(String projectIdOrKey, FilePart filePart, HttpServletRequest request)
Creates temporary avatar using multipart.
Response updateProject(String projectIdOrKey, String expand, ProjectInputBean updateData)
Updates a project.
Response updateProjectAvatar(String projectIdOrKey, AvatarBean avatarBean)
Response updateProjectType(String projectIdOrKey, String newProjectTypeKey)
Updates the type of a project.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int MAX_RECENT_PROJECTS

Constant Value: 20 (0x00000014)

Public Constructors

public ProjectResource (ProjectService projectService, JiraAuthenticationContext authContext, 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, CoreProjectConfigurator coreProjectConfigurator, JiraAvatarSupport jiraAvatarSupport, OrderByRequestParser orderByRequestParser)

Public Methods

public Response createAvatarFromTemporary (String projectIdOrKey, AvatarCroppingBean croppingInstructions)

Converts temporary avatar into a real avatar

Parameters
projectIdOrKey project id or project key
croppingInstructions cropping instructions
Returns
  • created avatar

public Response createProject (ProjectInputBean project)

Creates a new project.

Parameters
project new project details
Returns

public Response deleteAvatar (String projectIdOrKey, Long id)

Deletes avatar

Parameters
projectIdOrKey Project id or project key
id database id for avatar
Returns
  • no content response

public Response deleteProject (String projectIdOrKey)

Deletes a project.

Parameters
projectIdOrKey Project id or project key
Returns
  • no content response

public Response getAllAvatars (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.

public Response getAllProjects (String expand, Integer recent)

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).
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.

public Response getAllStatuses (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 possi

public Response getProject (String projectIdOrKey, 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

public Response getProjectComponents (String projectIdOrKey)

Contains a full representation of a the specified project's components.

Parameters
projectIdOrKey the project id or project key
Returns
  • the passed project's components.

public Response getProjectVersions (String projectIdOrKey, 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.

public Response getProjectVersionsPaginated (String projectIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand)

Returns all versions for the specified project. Results are paginated.

Results can be ordered by the following fields:

  • sequence
  • name
  • startDate
  • releaseDate

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.

public Response storeTemporaryAvatar (String projectIdOrKey, String filename, Long size, HttpServletRequest request)

Creates temporary avatar

Parameters
projectIdOrKey Project id or project key
filename name of file being uploaded
size size of file
request servlet request
Returns
  • temporary avatar cropping instructions

public Response storeTemporaryAvatarUsingMultiPart (String projectIdOrKey, FilePart filePart, 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

public Response updateProject (String projectIdOrKey, String expand, ProjectInputBean 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.

public Response updateProjectAvatar (String projectIdOrKey, AvatarBean avatarBean)

public Response updateProjectType (String projectIdOrKey, 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.