@PublicApi public interface

StatusService

com.atlassian.jira.bc.config.StatusService
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

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

Note: since @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).

Class Overview

This class contains methods for managing Statuses with validation

Summary

Constants
int MAX_STATUS_LENGTH Maximum length allowed for the name of a status.
Public Methods
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 moveStatusDown(ApplicationUser user, String id)
Move a status down the order.
ServiceResult moveStatusUp(ApplicationUser user, String id)
Move a status up the order.
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

Constants

public static final int MAX_STATUS_LENGTH

Maximum length allowed for the name of a status.

Constant Value: 60 (0x0000003c)

Public Methods

public 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

public 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

public 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

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

public boolean isStatusAsLozengeEnabled ()

Returns a boolean whether status lozenge is enabled or not

Returns
  • a boolean

public ServiceResult moveStatusDown (ApplicationUser user, String id)

Move a status down the order.

Parameters
user User performing operaiton
id Status id

public ServiceResult moveStatusUp (ApplicationUser user, String id)

Move a status up the order.

Parameters
user User performing operaiton
id Status id

public ServiceResult removeStatus (ApplicationUser user, Status status)

Removes a status.

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

public 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

public 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

public ServiceResult validateRemoveStatus (ApplicationUser user, Status status)

Validates removal of given status

Parameters
user User performing operation
status The Status