|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.bc.issue.DefaultIssueService
public class DefaultIssueService
The default implementation of the IssueService.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.jira.bc.issue.IssueService |
---|
IssueService.AssignValidationResult, IssueService.CreateValidationResult, IssueService.DeleteValidationResult, IssueService.IssueResult, IssueService.IssueValidationResult, IssueService.TransitionValidationResult, IssueService.UpdateValidationResult |
Constructor Summary | |
---|---|
DefaultIssueService(IssueFactory issueFactory,
IssueCreationHelperBean issueCreationHelperBean,
FieldManager fieldManager,
IssueManager issueManager,
PermissionManager permissionManager,
FieldScreenRendererFactory fieldScreenRendererFactory,
WorkflowManager workflowManager,
IssueUtilsBean issueUtilsBean,
FieldLayoutManager fieldLayoutManager,
FieldConfigSchemeManager fieldConfigSchemeManager)
|
Method Summary | |
---|---|
IssueService.IssueResult |
assign(com.atlassian.crowd.embedded.api.User user,
IssueService.AssignValidationResult assignResult)
This method will store the provided issue to the JIRA datastore and will transition it through workflow. |
IssueService.IssueResult |
create(com.atlassian.crowd.embedded.api.User user,
IssueService.CreateValidationResult createValidationResult)
This method will store the provided issue to the JIRA datastore. |
IssueService.IssueResult |
create(com.atlassian.crowd.embedded.api.User user,
IssueService.CreateValidationResult createValidationResult,
String initialWorkflowActionName)
This method will store the provided issue to the JIRA datastore. |
ErrorCollection |
delete(com.atlassian.crowd.embedded.api.User user,
IssueService.DeleteValidationResult issueValidationResult)
This method will delete an issue from JIRA. |
ErrorCollection |
delete(com.atlassian.crowd.embedded.api.User user,
IssueService.DeleteValidationResult issueValidationResult,
EventDispatchOption eventDispatchOption,
boolean sendMail)
This method will delete an issue from JIRA. |
IssueService.IssueResult |
getIssue(com.atlassian.crowd.embedded.api.User user,
Long issueId)
This method will retrieve the issue with the provided issue id if the current user has permission to view the issue. |
IssueService.IssueResult |
getIssue(com.atlassian.crowd.embedded.api.User user,
String issueKey)
This method will retrieve the issue with the provided issue id if the current user has permission to view the issue. |
boolean |
isEditable(Issue issue,
com.atlassian.crowd.embedded.api.User user)
Returns true if the issue can be edited by the current user. |
IssueInputParameters |
newIssueInputParameters()
Constructs a new IssueInputParameters object with no initial values. |
IssueInputParameters |
newIssueInputParameters(Map<String,String[]> actionParameters)
Constructs a new IssueInputParameters object with initial values provided by the input Map. |
IssueService.IssueResult |
transition(com.atlassian.crowd.embedded.api.User user,
IssueService.TransitionValidationResult transitionResult)
This method will store the provided issue to the JIRA datastore and will transition it through workflow. |
IssueService.IssueResult |
update(com.atlassian.crowd.embedded.api.User user,
IssueService.UpdateValidationResult issueValidationResult)
This method will store the provided issue to the JIRA datastore. |
IssueService.IssueResult |
update(com.atlassian.crowd.embedded.api.User user,
IssueService.UpdateValidationResult issueValidationResult,
EventDispatchOption eventDispatchOption,
boolean sendMail)
This method will store the provided issue to the JIRA datastore. |
IssueService.AssignValidationResult |
validateAssign(com.atlassian.crowd.embedded.api.User user,
Long issueId,
String assignee)
This method will check permissions to see if a user has the permission in relation to the provided issue, and that the assignee is assignable. |
IssueService.CreateValidationResult |
validateCreate(com.atlassian.crowd.embedded.api.User user,
IssueInputParameters issueInputParameters)
This method will validate parameters and check permissions and if all checks pass it will create an Issue
that can be passed to the IssueService.create(User, CreateValidationResult)
method. |
IssueService.DeleteValidationResult |
validateDelete(com.atlassian.crowd.embedded.api.User user,
Long issueId)
This method will check permissions to see if a user has the Permissions.DELETE_ISSUE
permission in relation to the provided issue. |
IssueService.CreateValidationResult |
validateSubTaskCreate(com.atlassian.crowd.embedded.api.User user,
Long parentId,
IssueInputParameters issueInputParameters)
This method does the same as IssueService.validateCreate(User, IssueInputParameters)
and it allows you to specify a parentId such that the created issue will be a subtask of the provided parent id. |
IssueService.TransitionValidationResult |
validateTransition(com.atlassian.crowd.embedded.api.User user,
Long issueId,
int actionId,
IssueInputParameters issueInputParameters)
This method will validate parameters and check the transition conditions and if all checks pass it will construct a new instance of the Issue and will update it with the new parameters. |
IssueService.UpdateValidationResult |
validateUpdate(com.atlassian.crowd.embedded.api.User user,
Long issueId,
IssueInputParameters issueInputParameters)
This method will validate parameters and check permissions and if all checks pass it will construct a new instance of the Issue and will update it with the new parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultIssueService(IssueFactory issueFactory, IssueCreationHelperBean issueCreationHelperBean, FieldManager fieldManager, IssueManager issueManager, PermissionManager permissionManager, FieldScreenRendererFactory fieldScreenRendererFactory, WorkflowManager workflowManager, IssueUtilsBean issueUtilsBean, FieldLayoutManager fieldLayoutManager, FieldConfigSchemeManager fieldConfigSchemeManager)
Method Detail |
---|
public IssueService.IssueResult getIssue(com.atlassian.crowd.embedded.api.User user, Long issueId)
IssueService
getIssue
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueId
- the database ID of the issue.
Issue
for the provided id if the user has the Permissions.BROWSE
permission for the issue, the issue will be null if the issue does not exist or the user does not have permission.
The result also contains an error collection that will contain any error messages that may have been generated
when performing the operation.public IssueService.IssueResult getIssue(com.atlassian.crowd.embedded.api.User user, String issueKey)
IssueService
getIssue
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueKey
- the key (e.g. TST-1) of the issue.
Issue
for the provided id if the user has the Permissions.BROWSE
permission for the issue, the issue will be null if the issue does not exist or the user does not have permission.
The result also contains an error collection that will contain any error messages that may have been generated
when performing the operation.public IssueService.CreateValidationResult validateCreate(com.atlassian.crowd.embedded.api.User user, IssueInputParameters issueInputParameters)
IssueService
Issue
that can be passed to the IssueService.create(User, CreateValidationResult)
method.
This method will validate that the provided parameters are valid for the fields that are specified by the
configured create screen for the provided project/issue type, unless over-ridden with the provided fields collection
in the IssueInputParameters. Any fields that are not included on the create
screen or provided fields will be populated with their default values and have those values validated.
If any validation fails then this method will return a null Issue. Whether the methods validation is a success
or a failure the fieldValuesHolder in the result will be populated with the data that is needed for the fields to render the
inputted raw parameters.
validateCreate
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueInputParameters
- this represents the issue values we want to validate. It contains access to a raw
map of "web" style input parameters. These parameters are used to allow the
fields to attain the user inputted values. If you would like to specify some seed values for the field values
holder that will be passed to the JIRA fields, then you should set your map on this input values. Also, if
you want to specify which fields have been provided for user input, set the provided fields on this input, if
not set this method will use the system defaults. Fields not in the provided fields collection
will not be validated but they will have their defaults set.
MutableIssue
if all validation
passes and the user has permission to create such an issue in the provided project, otherwise the issue will be null.
The result also contains an error collection that will contain any error messages that may have been generated
when performing the operation. It also contains a populated FieldValuesHolder that can be used by the fields
to re-render the user inputted values.public IssueService.CreateValidationResult validateSubTaskCreate(com.atlassian.crowd.embedded.api.User user, Long parentId, IssueInputParameters issueInputParameters)
IssueService
IssueService.validateCreate(User, IssueInputParameters)
and it allows you to specify a parentId such that the created issue will be a subtask of the provided parent id.
validateSubTaskCreate
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).parentId
- the id of the parent Issue
for this subtask.issueInputParameters
- this represents the issue values we want to validate. It contains access to a raw
map of "web" style input parameters. These parameters are used to allow the
fields to attain the user inputted values. If you would like to specify some seed values for the field values
holder that will be passed to the JIRA fields, then you should set your map on this input values. Also, if
you want to specify which fields have been provided for user input, set the provided fields on this input, if
not set this method will use the system defaults. Fields not in the provided fields collection
will not be validated but they will have their defaults set.
MutableIssue
if all validation
passes and the user has permission to create such an issue in the provided project, otherwise the issue will be null.
The result also contains an error collection that will contain any error messages that may have been generated
when performing the operation. It also contains a populated FieldValuesHolder that can be used by the fields
to re-render the user inputted values.public IssueService.IssueResult create(com.atlassian.crowd.embedded.api.User user, IssueService.CreateValidationResult createValidationResult)
IssueService
EventType.ISSUE_CREATED_ID
event, thus
triggering any notifications that may need to be sent.
create
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).createValidationResult
- contains the issue to store. This should have been created by one of the
validateCreate methods. The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.
Issue
if all went. If there was an error creating
the issue then the issue will be null and the error collection will contain details of what went wrong.public IssueService.IssueResult create(com.atlassian.crowd.embedded.api.User user, IssueService.CreateValidationResult createValidationResult, String initialWorkflowActionName)
IssueService
EventType.ISSUE_CREATED_ID
event, thus
triggering any notifications that may need to be sent.
create
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).createValidationResult
- contains the issue to store. This should have been created by one of the
validateCreate methods. The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.initialWorkflowActionName
- indicates which initial action to execute.
Issue
if all went. If there was an error creating
the issue then the issue will be null and the error collection will contain details of what went wrong.public IssueService.UpdateValidationResult validateUpdate(com.atlassian.crowd.embedded.api.User user, Long issueId, IssueInputParameters issueInputParameters)
IssueService
Issue
and will update it with the new parameters.
This object can then be passed to the IssueService.update(User, UpdateValidationResult)
method.
This method will validate that the provided parameters are valid for the fields that are specified by the
configured edit screen for the issues project/issue type. Any fields that are not included on the edit
screen will not be validated or populated.
If any validation fails then this method will return a null Issue. Whether the methods validation is a success
or a failure the fieldValuesHolder will be populated with the data that is needed for the fields to render
the inputted raw parameters.
The issue must also be in a open workflow state for this call to succeed.
validateUpdate
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueId
- the unique identifer for the issue to update, this must be an issue that exists in JIRA with a valid project/issue type.issueInputParameters
- this represents the issue values we want to validate. It contains access to a raw
map of "web" style input parameters. These parameters are used to allow the
fields to attain the user inputted values. If you would like to specify some seed values for the field values
holder that will be passed to the JIRA fields, then you should set your map on this input values. Also, if
you want to specify which fields have been provided for user input, set the provided fields on this input, if
not set this method will use the system defaults. Fields not in the provided fields collection
will not be validated but they will have their defaults set.
IssueService.update(User, UpdateValidationResult)
method which
contains an MutableIssue
populated with the updated values and the error
collection that contains any validation errors that may have occurred. It also contains a populated FieldValuesHolder
that can be used by the fields to re-render the user inputted values.public IssueService.IssueResult update(com.atlassian.crowd.embedded.api.User user, IssueService.UpdateValidationResult issueValidationResult)
IssueService
EventType.ISSUE_UPDATED_ID
event, thus
triggering any notifications that may need to be sent.
update
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueValidationResult
- that contains the issue to update, this should have been created via the
IssueService.validateUpdate(User, Long, IssueInputParameters)
method.
The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.
Issue
if all went. If there was an error updating
the issue then the issue will be null and the error collection will contain details of what went wrong.public IssueService.IssueResult update(com.atlassian.crowd.embedded.api.User user, IssueService.UpdateValidationResult issueValidationResult, EventDispatchOption eventDispatchOption, boolean sendMail)
IssueService
EventDispatchOption
. This method also allows you to specify if email
notifications should be send to notify users of the update.
update
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueValidationResult
- contains the issue to update, this should have been created via the
IssueService.validateUpdate(User, Long, com.atlassian.jira.issue.IssueInputParameters)
method.
The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.eventDispatchOption
- specifies if an event should be sent and if so which should be sent.sendMail
- if true mail notifications will be sent, otherwise mail notifications will be suppressed.
Issue
if all went. If there was an error updating
the issue then the issue will be null and the error collection will contain details of what went wrong.public IssueService.DeleteValidationResult validateDelete(com.atlassian.crowd.embedded.api.User user, Long issueId)
IssueService
Permissions.DELETE_ISSUE
permission in relation to the provided issue. If the current user does not have permission then an
error will be added to the service contexts error collection.
validateDelete
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueId
- the unique identifier of the issue to delete
IssueService.delete(User, com.atlassian.jira.bc.issue.IssueService.DeleteValidationResult)
method which
contains an MutableIssue
and the error
collection that contains any validation errors that may have occurred.public ErrorCollection delete(com.atlassian.crowd.embedded.api.User user, IssueService.DeleteValidationResult issueValidationResult)
IssueService
Permissions.DELETE_ISSUE
permission. This will clean up all issue
associations in JIRA and will de-index the issue.
This method will dispatch the EventType.ISSUE_DELETED_ID
event and will
generate email notifications.
delete
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueValidationResult
- contains the issue to delete, this should have been created via the
IssueService.validateDelete(User, Long)
method.
The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.
public ErrorCollection delete(com.atlassian.crowd.embedded.api.User user, IssueService.DeleteValidationResult issueValidationResult, EventDispatchOption eventDispatchOption, boolean sendMail)
IssueService
Permissions.DELETE_ISSUE
permission. This will clean up all issue
associations in JIRA and will de-index the issue.
This method should be used if you want to exert more control over what happens when JIRA deletes an issue. This
method will allow you to specify if an event is dispatched and if so which event is dispatched, see
EventDispatchOption
. This method also allows you to specify if email
notifications should be send to notify users of the deletion.
delete
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueValidationResult
- contains the issue to delete, this should have been created via the
IssueService.validateDelete(User, Long)
method.
The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.eventDispatchOption
- specifies if an event should be sent and if so which should be sent.sendMail
- if true mail notifications will be sent, otherwise mail notifications will be suppressed.
public boolean isEditable(Issue issue, com.atlassian.crowd.embedded.api.User user)
IssueService
true
if the issue can be edited by the current user. This is determined by looking at both the
user's permissions and the workflow step the issue is in.
isEditable
in interface IssueService
issue
- the issue you want to edituser
- the user who will be performing the edit
true
if the user has permission and the issue is in an editable workflow steppublic IssueService.TransitionValidationResult validateTransition(com.atlassian.crowd.embedded.api.User user, Long issueId, int actionId, IssueInputParameters issueInputParameters)
IssueService
Issue
and will update it with the new parameters. This object
can then be passed to the IssueService.transition(User, TransitionValidationResult)
method.
This method will validate that the provided parameters are valid for the fields that are specified by the
configured workflow transition screen for the issues project/issue type. Any fields that are not included on the
screen will not be validated or populated. If the transition has no view then the issue fields will not be validated.
If any validation fails then this method will return a null TransitionResult. Whether the methods validation is a success
or a failure the fieldValuesHolder will be populated with the data that is needed for the fields to render
the inputted raw parameters.
validateTransition
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueId
- the unique identifier for the issue to update, this must be an issue that exists in JIRA with a valid project/issue type.actionId
- is the id of the workflow action that you would like to transition the issue through.issueInputParameters
- this represents the issue values we want to validate. It contains access to a raw
map of "web" style input parameters. These parameters are used to allow the
fields to attain the user inputted values. If you would like to specify some seed values for the field values
holder that will be passed to the JIRA fields, then you should set your map on this input values. Also, if
you want to specify which fields have been provided for user input, set the provided fields on this input, if
not set this method will use the system defaults. Fields not in the provided fields collection
will not be validated but they will have their defaults set.
MutableIssue
populated with the
updated values and some additional parameters that are used when transitioning the issue through workflow and
the error collection that contains any validation errors that may have occurred. It also contains a populated FieldValuesHolder
that can be used by the fields to re-render the user inputted values.public IssueService.IssueResult transition(com.atlassian.crowd.embedded.api.User user, IssueService.TransitionValidationResult transitionResult)
IssueService
transition
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).transitionResult
- contains the issue to transition, with any updates that need to be persisted and
the action id which is the id of the workflow action that you would like to transition the issue through.
The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.
public IssueService.AssignValidationResult validateAssign(com.atlassian.crowd.embedded.api.User user, Long issueId, String assignee)
IssueService
validateAssign
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).issueId
- the unique identifier for the issue to update, this must be an issue that exists in JIRA with a valid project/issue type.assignee
- is the id of the user to assign the issue to.
MutableIssue
populated with the updated values and the error
collection that contains any validation errors that may have occurred. It also contains a populated FieldValuesHolder
that can be used by the fields to re-render the user inputted values.public IssueService.IssueResult assign(com.atlassian.crowd.embedded.api.User user, IssueService.AssignValidationResult assignResult)
IssueService
assign
in interface IssueService
user
- who the permission checks will be run against (can be null, indicating an anonymous user).assignResult
- contains the issue and assigneeId for the assignment.
The result must have ServiceResult.isValid()
return
true. If false this method will throw an IllegalStateException.
public IssueInputParameters newIssueInputParameters()
IssueService
IssueInputParameters is used as input to many of the methods in IssueService.
newIssueInputParameters
in interface IssueService
IssueService.newIssueInputParameters(java.util.Map)
public IssueInputParameters newIssueInputParameters(Map<String,String[]> actionParameters)
IssueService
This is often used to pass HTTP Parameters with Issue values eg:
issueService.newIssueInputParameters(ActionContext.getParameters())
IssueInputParameters is used as input to many of the methods in IssueService.
newIssueInputParameters
in interface IssueService
actionParameters
- Parameters as received by a HTTP Request
IssueService.newIssueInputParameters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |