Alejandro Corredor
Alejandro Corredor

Reputation: 345

Not getting results field after querying task by ID in Lookback API

I'm trying to query tasks by ObjectID to get their most recent snapshots. I'm trying the API out, and am not getting the expected results that I was hoping for after reading the docs. I don't get a results field in the response object. Here's my code:

_loadTaskSnapshot: function() {
        let snapshot = Ext.create('Rally.data.lookback.SnapshotStore', {
            context: {
                workspace: '/workspace/2290039850'
            },
            "find": {
                "ObjectID": 34858774310,
                "_ValidFrom": {
                    "$gte": "2016",
                    "$lt": "2017"
                }
            },
            "fields": ["Name", "Estimate", "ToDo", "TimeSpent"],
        });

        return snapshot.load();
    }

This is the store with 18 snapshots for the specified task. The first snapshot is opened. You can see there is no results field where I could find the Name, Estimate, ToDo, and TimeSpent:

This is the store with 18 snapshots for the specified task. The first snapshot is opened. You can see there is no results field where I could find the Name, Estimate, ToDo, and TimeSpent

Upvotes: 2

Views: 58

Answers (1)

NotApplicable
NotApplicable

Reputation: 251

Alejandro, you are asking for the changes in the fields, not the values of the fields. This is a common misconception with the lookback api. There is a special way to get the current values shown in the help pages available inside Agile Central.

Any information returned is actually held within the object underneath 'raw' and 'data'. Each of those may not contain any values if there has been no 'changes' to those fields at the time the snapshot was taken.

Upvotes: 3

Related Questions