@com.adaptavist.hapi.cloud.analytics.CloudTracked class Spaces extends java.lang.Object
A utility class for managing spaces (updated term for "projects") in Jira Cloud.
Spaces provides static methods that delegate to Projects, using updated
terminology. Every method in this class calls the corresponding method on Projects
under the hood, so behavior is identical.
Existing code using Projects continues to work unchanged. New code can use
Spaces for updated terminology.
// Retrieve a space by key
def space = Spaces.getByKey("TEST")
println "Space Name: ${space.name"
// Create a new space
def newSpace = Spaces.create("NEW", "New Space") {
description = "Space for managing tasks"
}
println "Created Space: ${newSpace.key}"
// List all spaces visible to the current user
Spaces.getAllSpaces().each {
println "Space: ${it.key} - ${it.name}"
}
}
| Constructor and description |
|---|
Spaces() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static Space |
create(java.lang.String key, java.lang.String name, groovy.lang.Closure<?> specification)Creates a space with the given key and name. |
|
static ProjectIterator |
getAllSpaces()Gets all spaces visible to the current logged in user. |
|
static Space |
getById(java.lang.Long id)Retrieves a space by its ID. |
|
static Space |
getByKey(java.lang.String key)Retrieves a space by its key. |
| 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 space with the given key and name.
Delegates to Projects.create.
Spaces.create('TEST', 'Test Space') {
description = 'A test space'
} key - the key the space should havename - the name the space should havespecification - closure containing parameters to set on the created spaceGets all spaces visible to the current logged in user.
Delegates to Projects.getAllProjects.
Retrieves a space by its ID.
Delegates to Projects.getById.
id - the ID of the spaceRetrieves a space by its key.
Delegates to Projects.getByKey.
key - the unique key of the space (e.g., "TEST")