Workorder status & timeDone

PB_ThePhoneLabPB_ThePhoneLab Member Posts: 4

Hi,

I am trying to analyse the lead time in our shop by looking at the time a workorder took to finish. When I look at the endpoint 'Workorder' (https://developers.lightspeedhq.com/retail/endpoints/Workorder/), there should be a field called 'timeDone'.

However, when I retrieve the data using our API, the column 'timeDone' is missing. Also, when looking at the example output on the right panel at the developers website, there is also no line called 'timeDone' included. Does anyone know how I can get retrieve these data?

Next to time finished, I want to subtract the time the workorder had status 'quotation', as this time is not something we have any influence on. It would be most optimal if I could get the data that shows the exact time every workorder took, divided in steps per status.

Looking forward to a reply!

Kind Regards,

Paulus

9 comments

  • gregaricangregarican Member Posts: 663 

    Good observation. I too confirmed this apparent gap. Even if you cross-reference the WorkorderStatus value to determine a Workorder has been completed, the timestamp of when it was flagged as such doesn't appear in the response body.

    @LucienVersendaal any chance you can take a look at this? Seems to be a pretty basic property, and is indeed listed in the API documentation...

  • bikehoundsbikehounds Member Posts: 12

    Woudn't the "timestamp" property accomplish this?

    Assuming it is not edited after it is completed, which seems like a valid assumption.

  • gregaricangregarican Member Posts: 663 

    This is a workaround, which might indeed work a vast majority of the time. Although there could be breaking cases here and there. A truly comprehensive API should expose the property fields that the actual client app can view and modify. Unfortunately it's the cards we are dealt in this instance...

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 706 moderator

    Hi all,

    I've checked the response of the workorder and wasn't able to find the timeDone so I need ask our devs and log this.

  • PB_ThePhoneLabPB_ThePhoneLab Member Posts: 4

    Hi!

    @LucienVersendaal I noticed that 'timeDone' was removed from the documentation. Does this implicate that timeDone won't be included in the API call or is it just temporary removed untill it's fixed?

    @bikehounds We allways remove the note in the workorder before we do the payment, so the workorder does get edited after it is completed. So this won't be a reliable solution unfortunately.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 706 moderator
    edited March 5

    @PB_ThePhoneLab,

    I've checked this with dev and for now it's not included in the API call, so I need to log this, so our devs can fix this. I did a small test to check how to see when a workorder is completed, but when a workorder is paid and finished you can check in WorkorderItems relation to see if there is a saleID and check the timestamp when this sale is created, which "completes" the workorder. Can you check if this works for you?


  • PB_ThePhoneLabPB_ThePhoneLab Member Posts: 4

    Hi @LucienVersendaal, my apologies for the late response. I've been out of the office for a while. I checked the TimeStamp and it seems to be working in some cases, but is not consistent for all the workorders. I will look further at other timestamps in different tables for a temporary solution.

    Next to that, is there a possibility to measure the amount of time a workorder had a certain status? I need to reduce the time of a workorder by the time the workorder had status 'quotation' to give a more representative result.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 706 moderator

    Hi @PB_ThePhoneLab,

    What you need to do is to check every X time and check if theworkorderStatusID has changed in comparison with the previous status. Below you see what I mean, the first screenshot is a comparison between the open work order and waiting work order. The timestamps and workorderStatusID are changed.

    Now when I changed to status to Finished the timestamp and workorderStatusID are changed.

    You need to create a calculation in your code to see the difference between the timeStamps.

    I hope this helps.

  • PB_ThePhoneLabPB_ThePhoneLab Member Posts: 4

    @LucienVersendaal I tried to work out your suggestion, however, the timestamp when a workorder status changed to finished overwrites the old timestamp. Meaning I only have the latest timeStamp available so I can not create a calculation to see the difference. Is there something I'm not thinking of?

Sign In or Register to comment.