interface Component
Represents a Jira Cloud project component and provides methods to retrieve and manipulate its properties.
This interface provides access to key details about a component, such as its ID, name, lead, and associated project. It also allows updating or deleting the component through declarative operations.
Example Usage:
// Retrieve a component by ID and update its details
def component = Components.getById("1001");
component.update {
setName("Backend Services");
setDescription("Handles all backend-related work.");
setDefaultAssigneeToProjectLead();
// Delete a component by ID
def componentToDelete = Components.getById("1002");
componentToDelete.delete();
} | Type Params | Return Type | Name and description |
|---|---|---|
|
abstract void |
delete() |
|
abstract com.atlassian.jira.rest.clientv2.model.ProjectComponent$AssigneeTypeEnum |
getAssigneeType()Retrieves the default assignee type for the component. |
|
abstract java.lang.String |
getId() |
|
abstract User |
getLead() |
|
abstract java.lang.String |
getName() |
|
abstract java.lang.String |
getProjectId() |
|
abstract java.lang.String |
getProjectKey() |
|
abstract Component |
update(groovy.lang.Closure<?> specification)Updates the properties of the component using a declarative closure. |
Retrieves the default assignee type for the component.
The default assignee type determines who is assigned to issues in this component by default. This can help establish clear responsibility for issues created within the component. Possible values include:
PROJECT_LEAD — The project lead is the default assignee for issues in this component.UNASSIGNED — Issues in this component are unassigned by default.Updates the properties of the component using a declarative closure.
This method allows modification of various attributes of a Jira project component, including:
Example Usage:
// Update the name, description, and default assignee for a component
component.update {
setName("New Component Name");
setDescription("Updated description for the component.");
setDefaultAssigneeToUnassigned();
}
Business Context:
Components are used to categorize and assign issues within a project. This method provides a convenient way to update component properties programmatically, ensuring alignment with changes in team structure or project organization.specification - a closure containing the updates to apply to the component. The closure operates
on an instance of ComponentUpdateDelegate.