countsOnly
When you send a request that creates, modifies, or operates upon hundreds or even thousands of Assets, it can make your response payload very large when it includes all of the OID Tokens in the response. To avoid this, specify the config: countsOnly
option, which will return just the number of Assets created, modified, or operated on.
Quickstart: using config: countsOnly
Suppose you want to set all Story
Assets in your system to the Done
status. Everybody worked all night for a week and got thousands of stories finished! While we don't advocate that practice as "agile", it does give us a scenario where your results payload could get enormous.
My local system has about 7000 Story Assets, so when I execute this:
from: Story
set:
Status: Done
I then get a response like this:
{
"requestId": "7763a3bb-6a5a-40a3-974b-ee2441c9bc9b",
"createdDate": "2017-04-05T19:24:49.7959936Z",
"completedDate": "2017-04-05T19:27:00.2065131Z",
"duration": "00:02:10.4105195",
"durationSeconds": 130.4105195,
"complete": true,
"processing": false,
"assetsCreated": {
"oidTokens": [],
"count": 0
},
"assetsModified": {
"oidTokens": [
"Story:3906",
"Story:3907",
"Story:3908",
// ... thousands more...
"Story:10936",
"Story:10943",
"Story:10948"
],
"count": 6892
},
"assetsOperatedOn": {
"oidTokens": [],
"count": 0
},
"queryResult": null
}
To tell the server to send only the counts, simply send a preliminary document, or array item if using JSON, in your request:
YAML
config: countsOnly
---
from: Story
set:
Status: Done
JSON
[
{
"config": "countsOnly"
},
{
"from": "Story",
"set": {
"Status": "Done"
}
}
]
Now, your response should look more like this, with only the count
property included within the assetsModified
property:
{
"requestId": "8995e7ee-8c14-4011-9ab2-bf1cabc638af",
"createdDate": "2017-04-05T19:31:01.0381637Z",
"completedDate": "2017-04-05T19:33:23.1818394Z",
"duration": "00:02:22.1436757",
"durationSeconds": 142.1436757,
"complete": true,
"processing": false,
"assetsCreated": {
"count": 0
},
"assetsModified": {
"count": 6892
},
"assetsOperatedOn": {
"count": 0
},
"queryResult": null
}