@groovy.transform.Trait trait Project extends java.lang.Object
| Type Params | Return Type | Name and description |
|---|---|---|
|
abstract Component |
createComponent(java.lang.String name, groovy.lang.Closure<?> specification)Creates a new component in the project with the specified name and additional configuration. |
|
abstract void |
delete() |
|
abstract User |
getArchivedBy() |
|
abstract java.time.OffsetDateTime |
getArchivedDate() |
|
abstract com.atlassian.jira.rest.clientv2.model.Project$AssigneeTypeEnum |
getAssigneeType() |
|
abstract java.util.Collection<Component> |
getComponents() |
|
abstract java.lang.String |
getDescription() |
|
abstract java.lang.String |
getEmail() |
|
abstract EntityProperties |
getEntityProperties()Retrieves the EntityProperties object associated with a project. |
|
abstract java.lang.String |
getId() |
|
abstract com.atlassian.jira.rest.clientv2.model.ProjectInsight |
getInsight() |
|
abstract java.util.List<com.atlassian.jira.rest.clientv2.model.IssueTypeDetails> |
getIssueTypes() |
|
abstract java.lang.String |
getKey() |
|
abstract User |
getLead() |
|
abstract java.lang.String |
getName() |
|
abstract com.atlassian.jira.rest.clientv2.model.ProjectPermissions |
getPermissions() |
|
abstract com.atlassian.jira.rest.clientv2.model.ProjectCategory |
getProjectCategory() |
|
abstract com.atlassian.jira.rest.clientv2.model.Project$ProjectTypeKeyEnum |
getProjectTypeKey() |
|
abstract java.time.OffsetDateTime |
getRetentionTillDate() |
|
abstract com.atlassian.jira.rest.clientv2.model.Project$StyleEnum |
getStyle() |
|
abstract java.lang.String |
getUrl() |
|
abstract java.util.UUID |
getUuid() |
|
abstract java.util.List<com.atlassian.jira.rest.clientv2.model.Version> |
getVersions() |
|
abstract java.lang.Boolean |
isPrivate() |
|
abstract java.lang.Boolean |
isSimplified() |
|
java.lang.String |
toString() |
|
abstract Project |
update(groovy.lang.Closure<?> specification)Updates the project with the specified changes. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Creates a new component in the project with the specified name and additional configuration.
A component is used to organize issues within a project, making it easier to group related tasks, assign responsibility, and filter issues. You can optionally configure properties like description, component lead, and default assignee within the provided closure.
Create a simple component with a name only:
Projects.getByKey("TEST").createComponent("Backend Services") {
// No additional configuration
}
Create a component with description and default assignee:
Projects.getByKey("TEST").createComponent("Database Layer") {
setDescription("Handles all database interactions for the project.")
setDefaultAssigneeToProjectLead()
}
Create a component with a specific lead user:
Projects.getByKey("TEST").createComponent("UI Design") {
setLeadAccountId("5b10a2844c20165700ede21g")
}
setName(String name) - The name of the component (mandatory).setDescription(String description) - A detailed description of the component.setDefaultAssigneeToProjectLead() - Assign the project lead as the default assignee.setDefaultAssigneeToUnassigned() - Leave the component unassigned by default.setLeadAccountId(String accountId) - Assign a specific user as the component lead using their account ID.leadAccountId must be a valid user account ID, which you can retrieve using the Jira
/people lookup page.name - the name of the component to createspecification - a groovy.lang.Closure to configure the component properties using
ComponentCreateDelegateRetrieves the EntityProperties object associated with a project.
Updates the project with the specified changes.
This method allows you to modify the project's attributes by providing a closure that defines the desired updates. The closure uses the ProjectUpdateDelegate to set various properties of the project, such as its name, key, description, category, and more. Only fields modified within the closure will be updated.
Projects.getByKey("PROJ").update {
setName("Updated Project Name")
setDescription("This is the updated project description.")
}
Projects.getByKey("PROJ").update {
setProjectCategory("Engineering")
}
Projects.getByKey("PROJ").update {
setDefaultAssigneeToProjectLead()
}
specification - a groovy.lang.Closure that uses ProjectUpdateDelegate to define the project updates