com.atlassian.jira.bc.config
Interface StatusService

All Known Implementing Classes:
DefaultStatusService

@PublicApi
public interface StatusService

This class contains methods for managing Statuses with validation

Since:
v6.1

Field Summary
static int MAX_STATUS_LENGTH
          Maximum length allowed for the name of a status.
 
Method Summary
 ServiceOutcome<Status> createStatus(ApplicationUser user, String name, String description, String iconUrl, StatusCategory statusCategory)
          Validates and when validation is performed successfully creates new status basing on given parameters
 ServiceOutcome<Status> editStatus(ApplicationUser user, Status status, String name, String description, String iconUrl, StatusCategory statusCategory)
          Validates and when validation is performed successfully alters given status basing on given parameters
 ServiceOutcome<List<JiraWorkflow>> getAssociatedWorkflows(ApplicationUser user, Status status)
          Gets a list of workflows which contains given status
 Status getStatusById(ApplicationUser user, String id)
          Get a status by id.
 boolean isStatusAsLozengeEnabled()
          Returns a boolean whether status lozenge is enabled or not
 ServiceResult removeStatus(ApplicationUser user, Status status)
          Removes a status.
 ServiceResult validateCreateStatus(ApplicationUser user, String name, String description, String iconUrl, StatusCategory statusCategory)
          Validates new status basing on given parameters
 ServiceResult validateEditStatus(ApplicationUser user, Status status, String name, String description, String iconUrl, StatusCategory statusCategory)
          Validates given status basing on given parameters
 ServiceResult validateRemoveStatus(ApplicationUser user, Status status)
          Validates removal of given status
 

Field Detail

MAX_STATUS_LENGTH

static final int MAX_STATUS_LENGTH
Maximum length allowed for the name of a status.

See Also:
Constant Field Values
Method Detail

createStatus

ServiceOutcome<Status> createStatus(ApplicationUser user,
                                    String name,
                                    String description,
                                    String iconUrl,
                                    StatusCategory statusCategory)
Validates and when validation is performed successfully creates new status basing on given parameters

Parameters:
user - User performing operation
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation
See Also:
validateCreateStatus(com.atlassian.jira.user.ApplicationUser, String, String, String, com.atlassian.jira.issue.status.category.StatusCategory)

validateCreateStatus

ServiceResult validateCreateStatus(ApplicationUser user,
                                   String name,
                                   String description,
                                   String iconUrl,
                                   StatusCategory statusCategory)
Validates new status basing on given parameters

Parameters:
user - User performing operation
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation

editStatus

ServiceOutcome<Status> editStatus(ApplicationUser user,
                                  Status status,
                                  String name,
                                  String description,
                                  String iconUrl,
                                  StatusCategory statusCategory)
Validates and when validation is performed successfully alters given status basing on given parameters

Parameters:
user - User performing operation
status - The status to be edited
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation
See Also:
validateEditStatus(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.status.Status, String, String, String, com.atlassian.jira.issue.status.category.StatusCategory)

validateEditStatus

ServiceResult validateEditStatus(ApplicationUser user,
                                 Status status,
                                 String name,
                                 String description,
                                 String iconUrl,
                                 StatusCategory statusCategory)
Validates given status basing on given parameters

Parameters:
user - User performing operation
status - The status to be edited
name - Name of the status. Should neither be blank nor duplicate existing name
description - Optional description of the status
iconUrl - URL of the icon for representing given status. May be relative or absolute. Cannot be null
statusCategory - StatusCategory for given status. Cannot be null
Returns:
The result of performed operation

getStatusById

Status getStatusById(ApplicationUser user,
                     String id)
Get a status by id.

Parameters:
user - User performing operation
id - status id
Returns:
the Status, or null if no status with this id exists.

removeStatus

ServiceResult removeStatus(ApplicationUser user,
                           Status status)
Removes a status.

Parameters:
user - User performing operation
status - Status
Returns:
The result of performed operation

validateRemoveStatus

ServiceResult validateRemoveStatus(ApplicationUser user,
                                   Status status)
Validates removal of given status

Parameters:
user - User performing operation
status - The Status
Returns:

getAssociatedWorkflows

ServiceOutcome<List<JiraWorkflow>> getAssociatedWorkflows(ApplicationUser user,
                                                          Status status)
Gets a list of workflows which contains given status

Parameters:
user - User performing operation
status - The Status
Returns:

isStatusAsLozengeEnabled

boolean isStatusAsLozengeEnabled()
Returns a boolean whether status lozenge is enabled or not

Returns:
a boolean


Copyright © 2002-2014 Atlassian. All Rights Reserved.