To retrieve and store all historical values, you need to loop through the JSON objects in the dealstage.versions array.
Per this article, your JavaScript could look something like this:
var dealstage = // Set this variable equal to the entire dealstage object for a deal.
for(var i = 0; i < dealstage.versions.length; i++) {
var version = versions[i]; // Do whatever you need with the properties in each version object. For example:
console.log(version.value);
}
From what you shared, it looks like that deal has one current dealstage value (retracted3) and two historical values (retracted2 and retracted). Are you claiming that there are more historical values which are not returned?
If so, can you direct message me a link to an example deal and the full, unredacted JSON of what you see included in the Get all deals endpoint's response for that particular deal?
Sorry for the delay on this. No all the dealstages get returned. I'm just not sure how to retrieve / store all of them. For example, one deal could have 4 stages and another could have 2. So I am not sure how exactly to retrieve and store them from the json output.
To retrieve and store all historical values, you need to loop through the JSON objects in the dealstage.versions array.
Per this article, your JavaScript could look something like this:
var dealstage = // Set this variable equal to the entire dealstage object for a deal.
for(var i = 0; i < dealstage.versions.length; i++) {
var version = versions[i]; // Do whatever you need with the properties in each version object. For example:
console.log(version.value);
}