public interface ProjectManager
Modifier and Type | Method and Description |
---|---|
List<Project> |
convertToProjectObjects(Collection<Long> projectIds)
Converts a collection of projectIds to a list of projects.
|
Project |
createProject(ApplicationUser user,
ProjectCreationData projectCreationData)
Creates the project in the database, and adds default project roles for this project.
|
ProjectCategory |
createProjectCategory(String name,
String description)
Creates a new ProjectCategory with the given name and description.
|
Collection<ProjectCategory> |
getAllProjectCategories()
Returns all ProjectCategories, ordered by name.
|
Set<String> |
getAllProjectKeys(Long projectId)
Returns all project keys that are associated with
Project . |
long |
getCurrentCounterForProject(Long id)
Returns the curremt issue counter for the given project.
|
ApplicationUser |
getDefaultAssignee(Project project,
Collection<ProjectComponent> components)
Gets the default assignee for an issue given its project and list of Components.
|
ApplicationUser |
getDefaultAssignee(Project project,
ProjectComponent component)
Deprecated.
Use
getDefaultAssignee(Project, java.util.Collection) which allows for multiple components. Since v4.4. |
long |
getNextId(Project project)
Get the next issue ID from this project (transactional).
|
Project |
getProjectByCurrentKey(String projectKey)
Returns the
Project with the given project key. |
Project |
getProjectByCurrentKeyIgnoreCase(String projectKey)
Returns a
Project object based on the passed in project key, not taking into account the case
of the project key. |
ProjectCategory |
getProjectCategory(Long id)
Returns a single project category by id.
|
ProjectCategory |
getProjectCategoryForProject(Project project)
Returns a project's category.
|
ProjectCategory |
getProjectCategoryObject(Long id)
Returns a single project category by id.
|
ProjectCategory |
getProjectCategoryObjectByName(String projectCategoryName)
Find a project category by name.
|
ProjectCategory |
getProjectCategoryObjectByNameIgnoreCase(String projectCategoryName)
Find a project category by name ignoring the case of the category name.
|
long |
getProjectCount()
Return the total number of
Project s. |
Project |
getProjectObj(Long id)
Retrieves a single
Project by its id. |
Project |
getProjectObjByKey(String projectKey)
Returns a
Project object based on the passed in project key. |
Project |
getProjectObjByKeyIgnoreCase(String projectKey)
Returns a
Project object based on the passed in project key, not taking into account the case
of the project key. |
Project |
getProjectObjByName(String projectName)
Returns a
Project object based on the passed in project name. |
List<Project> |
getProjectObjects()
Return all
Project s ordered by name. |
Collection<Project> |
getProjectObjectsFromProjectCategory(Long projectCategoryId)
Returns a list of projects in a particular category.
|
Collection<Project> |
getProjectObjectsWithNoCategory()
Returns a list of projects without project category, sorted by project name
|
List<Project> |
getProjects()
Return all
Project s ordered by name. |
Collection<Project> |
getProjectsFromProjectCategory(ProjectCategory projectCategory)
Returns a list of projects in a particular category.
|
List<Project> |
getProjectsLeadBy(ApplicationUser leadUser)
Returns all the projects that leadUser is the project lead for ordered by the name of the Project.
|
boolean |
isProjectCategoryUnique(String projectCategory)
Checks if a project category with a given name exists.
|
void |
refresh()
Causes a full refresh of the project cache.
|
void |
removeProject(Project project)
Deletes the provided project from the database.
|
void |
removeProjectCategory(Long id)
Removes the given ProjectCategory.
|
void |
removeProjectIssues(Project project)
Deprecated.
since v7.1.1. Use
removeProjectIssues(Project, Context) |
void |
removeProjectIssues(Project project,
Context taskContext)
Removes all issues for a particular project.
|
void |
setCurrentCounterForProject(Project project,
long counter)
Set the project counter.
|
void |
setProjectCategory(Project project,
ProjectCategory category)
Sets a project's category.
|
Project |
updateProject(Project originalProject,
String name,
String description,
String leadKey,
String url,
Long assigneeType)
Updates the project provided with the new attributes passed in.
|
Project |
updateProject(Project originalProject,
String name,
String description,
String leadKey,
String url,
Long assigneeType,
Long avatarId)
Updates the project provided with the new attributes passed in.
|
Project |
updateProject(Project originalProject,
String name,
String description,
String leadKey,
String url,
Long assigneeType,
Long avatarId,
String projectKey)
Updates the project provided with the new attributes passed in.
|
Project |
updateProject(UpdateProjectParameters parameters)
Updates the project with the given changes.
|
void |
updateProjectCategory(ProjectCategory projectCategory)
Persist an updated project category.
|
Project |
updateProjectType(ApplicationUser user,
Project project,
ProjectTypeKey newProjectType)
Updates the type of a project.
|
Project createProject(@Nonnull ApplicationUser user, @Nonnull ProjectCreationData projectCreationData)
If no name, key, lead or project type are provided an exception will be thrown.
user
- The user creating the projectprojectCreationData
- An object encapsulating all the data for the project that will get createdProjectCreationData
Project updateProject(Project originalProject, String name, String description, String leadKey, String url, Long assigneeType)
originalProject
- The project to be updated.name
- The name for the updated projectdescription
- An optional description for the projectleadKey
- The userkey of the lead developer for the projecturl
- An optional URL for the updated projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.Project updateProject(Project originalProject, String name, String description, String leadKey, String url, Long assigneeType, Long avatarId, String projectKey)
originalProject
- The project to be updated.name
- The name for the updated projectdescription
- An optional description for the projectleadKey
- The userkey of the lead developer for the projecturl
- An optional URL for the updated projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.projectKey
- The new project key (not updated if null)Project updateProject(Project originalProject, String name, String description, String leadKey, String url, Long assigneeType, Long avatarId)
originalProject
- The project to be updated.name
- The name for the updated projectdescription
- An optional description for the projectleadKey
- The userkey of the lead developer for the projecturl
- An optional URL for the updated projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.avatarId
- the id of an existing avatar.Project updateProject(UpdateProjectParameters parameters)
parameters
- containing the changes to the project that needs to be made.Project updateProjectType(ApplicationUser user, Project project, ProjectTypeKey newProjectType)
user
- The user performing the actionproject
- The project which type needs to be updatednewProjectType
- The new project typevoid removeProjectIssues(Project project) throws RemoveException
removeProjectIssues(Project, Context)
project
- The project for which issues will be deleted.RemoveException
- if there's any errors removing issuesvoid removeProjectIssues(Project project, Context taskContext) throws RemoveException
project
- The project for which issues will be deleted.taskContext
- A task context for providing progress.RemoveException
- if there's any errors removing issuesvoid removeProject(Project project)
ProjectService.deleteProject(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.bc.project.ProjectService.DeleteProjectValidationResult)
to
properly delete a project.project
- The project to be deleted.@Nullable Project getProjectObj(Long id) throws DataAccessException
Project
by its id.id
- ID of the Project.DataAccessException
- If any errors occur accessing the DB.Project getProjectObjByName(String projectName)
Project
object based on the passed in project name.projectName
- the name of the projectProject
object specified by the supplied name or nullProject getProjectObjByKey(String projectKey)
Project
object based on the passed in project key.projectKey
- the Project key.Project
object specified by the key or null@ExperimentalApi Project getProjectByCurrentKey(String projectKey)
Project
with the given project key.
This method will strictly only return the project whose current project key is the one given.
This method is added to the API in anticipation of being able to edit the project key, but this feature has not actually been added in 6.0.
projectKey
- the Project key.Project
with the given project key.getProjectObjByKey(String)
Project getProjectByCurrentKeyIgnoreCase(String projectKey)
Project
object based on the passed in project key, not taking into account the case
of the project key.projectKey
- the project key, case does not matter.Project getProjectObjByKeyIgnoreCase(String projectKey)
Project
object based on the passed in project key, not taking into account the case
of the project key. Matches also by previous keys that were associated with a project.projectKey
- the project key, case does not matter.Set<String> getAllProjectKeys(Long projectId)
Project
.@Nonnull List<Project> getProjects()
Project
s ordered by name.@Nonnull List<Project> getProjectObjects() throws DataAccessException
Project
s ordered by name.
This method does the same thing as getProjects() and exists for legacy reasons.
DataAccessException
- If any errors occur accessing the DB.getProjects()
long getProjectCount() throws DataAccessException
Project
s.DataAccessException
- if any errors occur accessing the DB.long getNextId(Project project) throws DataAccessException
project
- The ProjectDataAccessException
- If any errors occur accessing the DB.void refresh()
Collection<ProjectCategory> getAllProjectCategories() throws DataAccessException
DataAccessException
- If any errors occur accessing the DB.ProjectCategory getProjectCategory(Long id) throws DataAccessException
id
- ProjectCategory
id.ProjectCategory
for the provided id if it was found or else nullDataAccessException
- If any errors occur accessing the DB.@Nullable ProjectCategory getProjectCategoryObject(Long id) throws DataAccessException
Legacy synonym for getProjectCategory(Long)
id
- Project Category ID.DataAccessException
ProjectCategory getProjectCategoryObjectByName(String projectCategoryName)
projectCategoryName
- Name of the Project CategoryProjectCategory getProjectCategoryObjectByNameIgnoreCase(String projectCategoryName)
projectCategoryName
- Name of the Project Categoryvoid updateProjectCategory(ProjectCategory projectCategory) throws DataAccessException
projectCategory
- project category.DataAccessException
- If any errors occur accessing the DB.Collection<Project> getProjectsFromProjectCategory(ProjectCategory projectCategory) throws DataAccessException
projectCategory
- project category.DataAccessException
- If any errors occur accessing the DB.Collection<Project> getProjectObjectsFromProjectCategory(Long projectCategoryId) throws DataAccessException
projectCategoryId
- project category id.Project
s sorted by name.DataAccessException
- If any errors occur accessing the DB.Collection<Project> getProjectObjectsWithNoCategory() throws DataAccessException
Project
s sorted by nameDataAccessException
- If any errors occur accessing the DB.@Nullable ProjectCategory getProjectCategoryForProject(Project project) throws DataAccessException
project
- projectDataAccessException
- If any errors occur accessing the DB.void setProjectCategory(Project project, ProjectCategory category) throws DataAccessException
project
- projectcategory
- categoryDataAccessException
- If any errors occur accessing the DB.IllegalArgumentException
- if the project provided is nullProjectCategory createProjectCategory(String name, String description)
name
- the Namedescription
- the Description.void removeProjectCategory(Long id)
id
- the ProjectCategory to remove.boolean isProjectCategoryUnique(String projectCategory)
projectCategory
- the name of the project categoryApplicationUser getDefaultAssignee(Project project, ProjectComponent component)
getDefaultAssignee(Project, java.util.Collection)
which allows for multiple components. Since v4.4.project
- projectcomponent
- componentDefaultAssigneeException
- If the default assignee does NOT have ASSIGNABLE permission OR Unassigned issues are turned off.ApplicationUser getDefaultAssignee(Project project, Collection<ProjectComponent> components) throws DefaultAssigneeException
If the default assignee configuration is invalid, then a DefaultAssigneeException is thrown. This could be because the default is unassigned, and unassigned issues are not allowed, or because the default user does not have permission to be assigned to issues in this project.
project
- projectcomponents
- The componentsDefaultAssigneeException
- If the default assignee is invalid (eg user does not have assign permission) .List<Project> getProjectsLeadBy(ApplicationUser leadUser)
leadUser
- Project LeadList<Project> convertToProjectObjects(Collection<Long> projectIds)
Will return null if incoming collection is null.
The returned list of Project Objects will have the same sort order as the incoming collection of IDs.
projectIds
- a Collection of Project IDslong getCurrentCounterForProject(Long id)
id
- the ID of the project for which to retrieve the countervoid setCurrentCounterForProject(Project project, long counter)
project
- the project for which to set the counter (required)counter
- the counter value to setCopyright © 2002-2017 Atlassian. All Rights Reserved.