APIs & Integrations

ArnaudStephan
Participant

Cumulative time spent in a stage seems wrong

SOLVE

Hello,

I am using the deals API to get the cumulative time spent by my deals in each stage of our pipeline. However, the time is different between what the API returns and what I see in Hubspot.

For instance, using the API I see that this specific deal has spent 429882213 seconds in this stage. This amounts to 4975 days. 

ArnaudStephan_0-1739788513070.png


However, when looking up the deal directly in Hubspot I see that it has spent 21 days in this stage. 

ArnaudStephan_1-1739788588296.png

Am I using the API incorrectly ? How do I get the correct value ?

2 Accepted solutions
Bortami
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Cumulative time spent in a stage seems wrong

SOLVE

The API returns the time in milliseconds.  429882213 is 4.975 Days. 

 

Next steps for troubleshooting should be:

  • compare what the API is returning to the property value on the deal and not on this UI card. There could be additional logic behind what is displayed on that card. 
  • validate the internal id of the pipeline stage is the correct id. 

Here is how the time is calculated on the properties: https://knowledge.hubspot.com/properties/stage-calculated-properties

Here is how the time is calculated on the card: https://knowledge.hubspot.com/records/use-cards-on-records#stage-tracker

 

View solution in original post

GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Cumulative time spent in a stage seems wrong

SOLVE

Hi @ArnaudStephan 

 

I think that the return value is not in seconds because 21 days is equal to 1,814,400 seconds.
So could you please check the unit of the returned value?

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

0 Upvotes
4 Replies 4
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Cumulative time spent in a stage seems wrong

SOLVE

Hi @ArnaudStephan 

 

I think that the return value is not in seconds because 21 days is equal to 1,814,400 seconds.
So could you please check the unit of the returned value?

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes
Bortami
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Cumulative time spent in a stage seems wrong

SOLVE

The API returns the time in milliseconds.  429882213 is 4.975 Days. 

 

Next steps for troubleshooting should be:

  • compare what the API is returning to the property value on the deal and not on this UI card. There could be additional logic behind what is displayed on that card. 
  • validate the internal id of the pipeline stage is the correct id. 

Here is how the time is calculated on the properties: https://knowledge.hubspot.com/properties/stage-calculated-properties

Here is how the time is calculated on the card: https://knowledge.hubspot.com/records/use-cards-on-records#stage-tracker

 

ArnaudStephan
Participant

Cumulative time spent in a stage seems wrong

SOLVE

Thanks ! The proprerty description should maybe be updated then, but that's another topic !

ArnaudStephan_0-1739817531109.png

I will check out the documentation to understand why the app shows 21 days and the API gives 5.

 

0 Upvotes
BérangèreL
Community Manager
Community Manager

Cumulative time spent in a stage seems wrong

SOLVE

Hi @ArnaudStephan, I hope that you are keeping well!

Thanks for asking the HubSpot Community!

I'd like to share these similar threads that might be of interest, even though they are not via API ; but via the user interface:

- Use deal and lead stage calculated properties
- The solutions from @LRehn and @karstenkoehler on this post "Create "time in deal stage" report"
- The solution from @karstenkoehler on this post "Calculating cumulative time in deal stages?"
- The solution from @karstenkoehler on this post "Deal Stages report on time spent in each deal stage"
- The solution from @karstenkoehler on this post "Average time per deal stage (open deals)"

Also, I'd love to ask out Top Experts: Hi @Bortami, @Teun and @HubSpot_Corey do you have suggestions to help @ArnaudStephan, please?

Have a lovely day and thanks so much! ❤️

Best,
Bérangère


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres! !
0 Upvotes