com.atlassian.jira.bc.project.ProjectService |
Known Indirect Subclasses |
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/implement).
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ProjectService.AbstractProjectResult | |||||||||||
ProjectService.AbstractProjectValidationResult | |||||||||||
ProjectService.CreateProjectResult | |||||||||||
ProjectService.CreateProjectValidationResult | |||||||||||
ProjectService.DeleteProjectResult | |||||||||||
ProjectService.DeleteProjectValidationResult | |||||||||||
ProjectService.GetProjectResult | |||||||||||
ProjectService.UpdateProjectSchemesValidationResult | |||||||||||
ProjectService.UpdateProjectValidationResult |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_NAME_LENGTH | Default project name length | |||||||||
int | MAX_KEY_LENGTH | This constant is deprecated. use getMaximumKeyLength() instead | |||||||||
int | MAX_NAME_LENGTH | This constant is deprecated. use getMaximumNameLength() instead; | |||||||||
int | MIN_NAME_LENGTH | The minimum length allowed for the project name field. | |||||||||
String | PROJECT_DESCRIPTION | The default name of HTML fields containing a Project's description. | |||||||||
String | PROJECT_KEY | The default name of HTML fields containing a Project's key. | |||||||||
String | PROJECT_LEAD | The default name of HTML fields containing a Project's lead. | |||||||||
String | PROJECT_NAME | The default name of HTML fields containing a Project's name. | |||||||||
String | PROJECT_URL | The default name of HTML fields containing a Project's URL. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Using the validation result from
validateCreateProject(User, String, String, String, String, String, Long) a new project will be created. | |||||||||||
Deletes the project provided by the deleteProjectValidationResult.
| |||||||||||
Deletes the project provided by the deleteProjectValidationResult.
| |||||||||||
Used to retrieve a list of
Project objects. | |||||||||||
Used to retrieve a list of
Project objects. | |||||||||||
Used to retrieve a list of
Project objects. | |||||||||||
Used to retrieve a list of
Project objects. | |||||||||||
Used to retrieve the maximum length allowed for new project keys.
| |||||||||||
Used to retrieve the maximum length allowed for new project names.
| |||||||||||
Used to retrieve a
Project object by id. | |||||||||||
Used to retrieve a
Project object by id. | |||||||||||
Used to retrieve a
Project object by id providing the user can perform the
passed action on the project. | |||||||||||
Used to retrieve a
Project object by id providing the user can perform the
passed action on the project. | |||||||||||
Used to retrieve a
Project object by key. | |||||||||||
Used to retrieve a
Project object by key. | |||||||||||
Used to retrieve a
Project object by key providing the user can perform the
passed action on the project. | |||||||||||
Used to retrieve a
Project object by key providing the user can perform the
passed action on the project. | |||||||||||
Used to retrieve the total number of
Project s, regardless of the permission to see those projects. | |||||||||||
Get the project key description from the properties file.
| |||||||||||
Validates the given project fields.
| |||||||||||
Validates the given project fields.
| |||||||||||
Validates the given project key.
| |||||||||||
Validate the fields required for creating a project.
| |||||||||||
Using the validation result from
validateUpdateProject(User, String, String, String, String, String, Long) this method performs the actual update on the project. | |||||||||||
Updates the project schemes for a particular project, given a validation result and project to update.
| |||||||||||
This method needs to be called before creating a project to ensure all parameters are correct.
| |||||||||||
This method needs to be called before creating a project to ensure all parameters are correct.
| |||||||||||
Validation to delete a project is quite straightforward.
| |||||||||||
Validation to delete a project is quite straightforward.
| |||||||||||
Validates updating a project's details.
| |||||||||||
Validates updating a project's details.
| |||||||||||
Validates updating a project's details.
| |||||||||||
Validates that the given user is authorised to update a project.
| |||||||||||
Validates updating a project's details.
| |||||||||||
Validates updating a project's details.
| |||||||||||
Validates that the given user is authorised to update a project.
| |||||||||||
If the scheme ids are not null or -1 (-1 is often used to reset schemes), then an attempt will be made to
retrieve the scheme.
| |||||||||||
If the scheme ids are not null or -1 (-1 is often used to reset schemes), then an attempt will be made to
retrieve the scheme.
|
Default project name length
This constant is deprecated.
use getMaximumKeyLength() instead
The maximum length allowed for the project key field.
This constant is deprecated.
use getMaximumNameLength() instead;
The maximum length allowed for the project name field.
The minimum length allowed for the project name field.
The default name of HTML fields containing a Project's description. Validation methods on this service
(isValidAllProjectData) will return an ErrorCollection
with error messages keyed
to this field name.
The default name of HTML fields containing a Project's key. Validation methods on this service
(isValidAllProjectData) will return an ErrorCollection
with error messages keyed
to this field name.
The default name of HTML fields containing a Project's lead. Validation methods on this service
(isValidAllProjectData) will return an ErrorCollection
with error messages keyed
to this field name.
The default name of HTML fields containing a Project's name. Validation methods on this service
(isValidAllProjectData) will return an ErrorCollection
with error messages keyed
to this field name.
The default name of HTML fields containing a Project's URL. Validation methods on this service
(isValidAllProjectData) will return an ErrorCollection
with error messages keyed
to this field name.
Using the validation result from validateCreateProject(User, String, String, String, String, String, Long)
a new project will be created. This method will throw an IllegalStateException if
the validation result contains any errors.
createProjectValidationResult | Result from the validation, which also contains all the project's details. |
---|
IllegalStateException | if the validation result contains any errors. |
---|
Deletes the project provided by the deleteProjectValidationResult. There's a number of steps involved in deleting a project, which are carried out in the following order:
user | The user trying to delete a project |
---|---|
deleteProjectValidationResult | Result from the validation, which also contains all the project's details. |
Deletes the project provided by the deleteProjectValidationResult. There's a number of steps involved in deleting a project, which are carried out in the following order:
user | The user trying to delete a project |
---|---|
deleteProjectValidationResult | Result from the validation, which also contains all the project's details. |
Used to retrieve a list of Project
objects. This method returns a
ServiceOutcome
containing a list of projects. The list will be empty, if the user does not have
the BROWSE project permission for any project or no projects are visible when using anonymous access.
user | The user retrieving the list of projects or NULL when using anonymous access. |
---|
Used to retrieve a list of Project
objects. This method returns a
ServiceOutcome
containing a list of projects. The list will be empty, if the user does not have
the BROWSE project permission for any project or no projects are visible when using anonymous access.
user | The user retrieving the list of projects or NULL when using anonymous access. |
---|
Used to retrieve a list of Project
objects. This method returns a
ServiceOutcome
containing a list of projects that the user can perform the passed
action on. The list will be empty if no projects match the passed action.
user | The user retrieving the list of projects or NULL when using anonymous access. |
---|---|
action | the action the user must be able to perform on the returned projects. |
Used to retrieve a list of Project
objects. This method returns a
ServiceOutcome
containing a list of projects that the user can perform the passed
action on. The list will be empty if no projects match the passed action.
user | The user retrieving the list of projects or NULL when using anonymous access. |
---|---|
action | the action the user must be able to perform on the returned projects. |
Used to retrieve the maximum length allowed for new project keys.
Used to retrieve the maximum length allowed for new project names.
Used to retrieve a Project
object by id. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the id
specified can be found, or if the user making the request does not have the BROWSE project permission for the
project. In both of these cases, the errorCollection in the result object will contain an appropriate error
message.
user | The user retrieving the project. |
---|---|
id | The id of the project. |
Used to retrieve a Project
object by id. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the id
specified can be found, or if the user making the request does not have the BROWSE project permission for the
project. In both of these cases, the errorCollection in the result object will contain an appropriate error
message.
user | The user retrieving the project. |
---|---|
id | The id of the project. |
Used to retrieve a Project
object by id providing the user can perform the
passed action on the project. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the
id specified can be found, or if the user making the request cannot perform the passed action on the project.
In both of these cases, the errorCollection in the result object will contain an appropriate error message.
user | The user retrieving the project. |
---|---|
id | The id of the project. |
action | the action the user must be able to perform on the project. |
Used to retrieve a Project
object by id providing the user can perform the
passed action on the project. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the
id specified can be found, or if the user making the request cannot perform the passed action on the project.
In both of these cases, the errorCollection in the result object will contain an appropriate error message.
user | The user retrieving the project. |
---|---|
id | The id of the project. |
action | the action the user must be able to perform on the project. |
Used to retrieve a Project
object by key. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the
key specified can be found, or if the user making the request does not have the BROWSE project permission for the
project. In both of these cases, the errorCollection in the result object will contain an appropriate error
message.
user | The user retrieving the project. |
---|---|
key | The key of the project. |
Used to retrieve a Project
object by key. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the
key specified can be found, or if the user making the request does not have the BROWSE project permission for the
project. In both of these cases, the errorCollection in the result object will contain an appropriate error
message.
user | The user retrieving the project. |
---|---|
key | The key of the project. |
Used to retrieve a Project
object by key providing the user can perform the
passed action on the project. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the
key specified can be found, or if the user making the request cannot perform the passed action on the project.
In both of these cases, the errorCollection in the result object will contain an appropriate error message.
user | The user retrieving the project. |
---|---|
key | The key of the project. |
action | the action the user must be able to perform on the project. |
Used to retrieve a Project
object by key providing the user can perform the
passed action on the project. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the
key specified can be found, or if the user making the request cannot perform the passed action on the project.
In both of these cases, the errorCollection in the result object will contain an appropriate error message.
user | The user retrieving the project. |
---|---|
key | The key of the project. |
action | the action the user must be able to perform on the project. |
Used to retrieve the total number of Project
s, regardless of the permission to see those projects.
Get the project key description from the properties file. If the user has specified a custom regex that project keys must conform to and a description for that regex, this method should return the description.
If the user has not specified a custom regex, this method will return the default project key description: "Usually the key is just 3 letters - i.e. if your project name is Foo Bar Raz, a key of FBR would make sense.Validates the given project fields. Any errors will be added to the
JiraServiceContext
.
serviceContext | containing the ErrorCollection that will be populated with any validation errors that are encountered |
---|---|
name | the name of the project @Nonnull |
key | the key of the project @Nonnull |
leadName | the username of the project lead @Nonnull |
url | the project URL (optional) |
assigneeType | the default assignee type (optional - only appears on some forms) |
Validates the given project fields. Any errors will be added to the
JiraServiceContext
.
serviceContext | containing the ErrorCollection that will be populated with any validation errors that are encountered |
---|---|
name | the name of the project @Nonnull |
key | the key of the project @Nonnull |
leadName | the username of the project lead @Nonnull |
url | the project URL (optional) |
assigneeType | the default assignee type (optional - only appears on some forms) |
avatarId | the id of the avatar (null indicates default avatar) |
Validates the given project key. Any errors will be added to the
JiraServiceContext
.
serviceContext | containing the ErrorCollection that will be populated with any validation errors that are encountered |
---|---|
key | The key to validate @Nonnull |
Validate the fields required for creating a project. Any errors will be added to the
JiraServiceContext
.
serviceContext | containing the ErrorCollection that will be populated with any validation errors that are encountered |
---|---|
name | the name of the project @Nonnull |
key | the key of the project @Nonnull |
leadName | the username of the project lead @Nonnull |
Using the validation result from validateUpdateProject(User, String, String, String, String, String, Long)
this method performs the actual update on the project.
updateProjectValidationResult | Result from the validation, which also contains all the project's details. |
---|
IllegalStateException | if the validation result contains any errors. |
---|
Updates the project schemes for a particular project, given a validation result and project to update.
result | Result from the validation, which also contains all the schemes details. |
---|---|
project | The project which will have its schemes updated. |
IllegalStateException | if the validation result contains any errors. |
---|
This method needs to be called before creating a project to ensure all parameters are correct. There are a number of required parameters, such as a project name, key and lead. The validation will also check if a project with the name or key provided already exists and throw an appropriate error. The project key will be validated that it matches the allowed key pattern, and it is not a reserved word. A validation error will also be added if no user exists for the lead username provided.
Optional validation will be done for the url, assigneetype and avatarId parameters. The url needs to be a valid URL and the assigneeType needs to be eitherPROJECT_LEAD
,
UNASSIGNED
, or null to let JIRA decide on the best default
assignee. UNASSIGNED will also only be valid, if unassigned issues are enabled in the General Configuration.
The method will return a ProjectService.CreateProjectValidationResult
which
contains an ErrorCollection with any potential errors and all the project's details.user | The user trying to create a project |
---|---|
name | The name of the new project |
key | The project key of the new project |
description | An optional description for the project |
leadName | The username of the lead developer for the project |
url | An optional URL for the new project |
assigneeType | Optional default assignee for issues created in this project (null for default). |
avatarId | the id of an avatar. |
This method needs to be called before creating a project to ensure all parameters are correct. There are a number of required parameters, such as a project name, key and lead. The validation will also check if a project with the name or key provided already exists and throw an appropriate error. The project key will be validated that it matches the allowed key pattern, and it is not a reserved word. A validation error will also be added if no user exists for the lead username provided.
The default avatar will be used for the created project. Optional validation will be done for the url, assigneetype and avatarId parameters. The url needs to be a valid URL and the assigneeType needs to be eitherPROJECT_LEAD
,
UNASSIGNED
, or null to let JIRA decide on the best default
assignee. UNASSIGNED will also only be valid, if unassigned issues are enabled in the General Configuration.
The method will return a ProjectService.CreateProjectValidationResult
which
contains an ErrorCollection with any potential errors and all the project's details.user | The user trying to create a project |
---|---|
name | The name of the new project |
key | The project key of the new project |
description | An optional description for the project |
leadName | The username of the lead developer for the project |
url | An optional URL for the new project |
assigneeType | Optional default assignee for issues created in this project (null for default). |
Validation to delete a project is quite straightforward. The user must have global admin rights and the project about to be deleted needs to exist.
user | The user trying to delete a project |
---|---|
key | The key of the project to delete |
Validation to delete a project is quite straightforward. The user must have global admin rights and the project about to be deleted needs to exist.
user | The user trying to delete a project |
---|---|
key | The key of the project to delete |
Validates updating a project's details. The project is looked up by the key provided. If no project with the key provided can be found, an appropriate error will be added to the result.
Validation performed will be the same as for thevalidateCreateProject(User, String, String, String, String, String, Long)
method. The only difference is that the project key will obviously
not be validated.
A project can be updated by any user with the global admin permission or project admin permission for the project
in question.
WARNING: In 6.0-6.0.5, this method is available but does not work properly for renamed users (JRA-33843).user | The user trying to update a project |
---|---|
name | The name of the new project |
key | The project key of the project to update. |
description | An optional description for the project |
lead | The lead developer for the project |
url | An optional URL for the project |
assigneeType | The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled. |
Validates updating a project's details. The project is looked up by the project object. You may change the project key.
Validation performed will be the same as for thevalidateCreateProject(User, String, String, String, String, String, Long)
method.
A project can be updated by any user with the global admin permission or project admin permission for the project
in question. A project key can be updated by any user with the global admin permission.user | The user trying to update a project |
---|---|
originalProject | The project to update with the values put in arguments (Project object should not be modified) |
name | The name of the new project |
key | The new project key |
description | An optional description for the project |
lead | The user key for the lead developer for the project |
url | An optional URL for the project |
assigneeType | The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled. |
Validates updating a project's details. The project is looked up by the key provided. If no project with the key provided can be found, an appropriate error will be added to the result.
Validation performed will be the same as for thevalidateCreateProject(User, String, String, String, String, String, Long)
method. The only difference is that the project key will obviously
not be validated.
A project can be updated by any user with the global admin permission or project admin permission for the project
in question.user | The user trying to update a project |
---|---|
name | The name of the new project |
key | The project key of the project to update. |
description | An optional description for the project |
leadName | The username of the lead developer for the project |
url | An optional URL for the project |
assigneeType | 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. |
Validates that the given user is authorised to update a project. A project can be updated by any user with the global admin permission or project admin permission for the project in question.
user | The user trying to update a project |
---|---|
key | The project key of the project to update. |
Validates updating a project's details. The project is looked up by the key provided. If no project with the key provided can be found, an appropriate error will be added to the result.
Validation performed will be the same as for thevalidateCreateProject(User, String, String, String, String, String, Long)
method. The only difference is that the project key will obviously
not be validated.
A project can be updated by any user with the global admin permission or project admin permission for the project
in question.
WARNING: In 6.0-6.0.5, this method is available but does not work properly for renamed users (JRA-33843).user | The user trying to update a project |
---|---|
name | The name of the new project |
key | The project key of the project to update. |
description | An optional description for the project |
lead | The lead developer for the project |
url | An optional URL for the project |
assigneeType | 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. |
Validates updating a project's details. The project is looked up by the key provided. If no project with the key provided can be found, an appropriate error will be added to the result.
Validation performed will be the same as for thevalidateCreateProject(User, String, String, String, String, String, Long)
method. The only difference is that the project key will obviously
not be validated.
A project can be updated by any user with the global admin permission or project admin permission for the project
in question.user | The user trying to update a project |
---|---|
name | The name of the new project |
key | The project key of the project to update. |
description | An optional description for the project |
leadName | The username of the lead developer for the project |
url | An optional URL for the project |
assigneeType | The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled. |
Validates that the given user is authorised to update a project. A project can be updated by any user with the global admin permission or project admin permission for the project in question.
user | The user trying to update a project |
---|---|
key | The project key of the project to update. |
If the scheme ids are not null or -1 (-1 is often used to reset schemes), then an attempt will be made to retrieve the scheme. If this attempt fails an error will be added. IssueSecuritySchemes will only be validated in enterprise edition.
permissionSchemeId | The permission scheme that the new project should use |
---|---|
notificationSchemeId | The notification scheme that the new project should use. Optional. |
issueSecuritySchemeId | The issue security scheme that the new project should use. Optional. |
If the scheme ids are not null or -1 (-1 is often used to reset schemes), then an attempt will be made to retrieve the scheme. If this attempt fails an error will be added. IssueSecuritySchemes will only be validated in enterprise edition.
permissionSchemeId | The permission scheme that the new project should use |
---|---|
notificationSchemeId | The notification scheme that the new project should use. Optional. |
issueSecuritySchemeId | The issue security scheme that the new project should use. Optional. |