DoubleYouGTT / hubspot

R package πŸ“¦ for working with Hubspot πŸ‘©β€πŸ’ΌπŸ‘¨β€πŸ’Ό data
https://itsalocke.com/hubspot/
Other
10 stars 8 forks source link

get_deals not returning all versions when property_history = true #63

Closed seanofahey closed 4 years ago

seanofahey commented 4 years ago

Issue: When making a get_deals call with property_history = "true", the function returns only the latest version of a property instead of all historical versions of the property as expected.

Cause: The property_history parameter is being passed in the query but the HubSpot API propertiesWithHistory parameter is similar to the properties parameter and can be used multiple times with different properties (rather than being a boolean parameter that applies to all properties like includeAssociations). - https://developers.hubspot.com/docs/methods/deals/get-all-deals

Potential Fixes: Two potential ways to address this would be 1) use the property_history = "true" parameter to change the key values in the query from "property" to "propertyWithHistory" (this would make all properties either have history or not), or 2) add a new parameter to get_deals for propertiesWithHistory to allow returning of histories for a subset of properties.