This article is for Structure Data Center.
Problem
I want to get the Original Estimate, Remaining Estimate, and Time Spent values from columns of my structure using REST API.
Solution
Here is an example payload for extracting Original Estimate, Remaining Estimate, and Time Spent columns (in my example - from structure 111, for three issues in it, each issue has its own unique RowID):
{
"requests": [
{
"forestSpec": {
"structureId": 111
},
"rows": [
20490,
20492,
20496
],
"attributes": [
{
"id": "timeoriginalestimate",
"format": "number"
},
{
"id": "timeestimate",
"format": "number"
},
{
"id": "timespent",
"format": "number"
}
]
}
]
}
If the ‘Sum over sub-items’ option is enabled in either of these columns, the payload for extracting the aggregated values should look like this:
{
"requests": [
{
"forestSpec": {
"structureId": 1371
},
"rows": [
20490,
20492,
20496
],
"attributes": [
{"id": "sum", "format": "html", "params": {"attribute": {"id": "timeestimate", "format": "duration"}}}
]
}
]
}
You can find the specification for the column in the browser by checking the payload for the value request.
In both cases, you can set the format to number to get the timestamp or to html to get the formatted value with h/d/w.
To find more information about extracting data from structures using REST API, please feel free to check out our documentation: https://help.tempo.io/structure-dc/latest/structure-rest-api-reference