@com.adaptavist.hapi.platform.analytics.Tracked class Assets extends java.lang.Object
Constructor and description |
---|
Assets() |
Type Params | Return Type | Name and description |
---|---|---|
|
static long |
count(java.lang.String iql) Counts the number of objects matching an IQL query. |
|
static com.riadalabs.jira.plugins.insight.services.model.ObjectBean |
create(java.lang.String schemaName, java.lang.String objectTypeName, groovy.lang.Closure<?> specification) Create an Asset object: Assets.create('MY', 'My object type') { setAttribute('Name', 'Name of my object') setAttribute('A date attribute', new Date()) } |
|
static com.riadalabs.jira.plugins.insight.services.model.ObjectBean |
create(int objectTypeId, groovy.lang.Closure<?> specification) Create an Asset object: Assets.create(1) { setAttribute('Name', 'Name of my object') setAttribute('A date attribute', new Date()) } |
|
static com.riadalabs.jira.plugins.insight.services.model.ObjectBean |
getById(java.lang.Integer objectId) Gets an Asset object by ID |
|
static com.riadalabs.jira.plugins.insight.services.model.ObjectBean |
getByKey(java.lang.String objectKey) Gets an Asset object by key |
|
static java.util.Iterator<com.riadalabs.jira.plugins.insight.services.model.ObjectBean> |
search(java.lang.String iql) Execute the IQL query and returns matching objects. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Counts the number of objects matching an IQL query. Example:
Assets.count('objectType = "CPU"')This is much more efficient than executing a
searchand counting the results.
Create an Asset object:
Assets.create('MY', 'My object type') { setAttribute('Name', 'Name of my object') setAttribute('A date attribute', new Date()) }
schemaName
- the name of the schemaobjectTypeName
- the name of the objectspecification
- describes how to create the objectCreate an Asset object:
Assets.create(1) { setAttribute('Name', 'Name of my object') setAttribute('A date attribute', new Date()) }
objectTypeId
- the ID of the objectspecification
- describes how to create the objectGets an Asset object by ID
Gets an Asset object by key
Execute the IQL query and returns matching objects. You can iterate over the objects in the response:
Assets.search('objectSchemaId = 1 and objectType = "CPU" order by label desc').each { // do something with it }