Martyn Houghton Posted March 14, 2018 Posted March 14, 2018 I am looking to report on the time spent on a request, similar what is displayed on the Request form. Is this dynamically calculated from the time sheet entries or is the total stored on the request record/entity itself? Cheers Martyn
Daniel Dekel Posted March 14, 2018 Posted March 14, 2018 1 hour ago, Martyn Houghton said: time spent on a request, similar what is displayed on the Request form Can you explain the difference between the request and request form? I don't understand what area are you talking about. Cheers, Daniel
Martyn Houghton Posted March 14, 2018 Author Posted March 14, 2018 @Daniel Dekel What I am trying to find out is is the Total Time display on the request form is calculated dynamically or is the total held on the database in the request table/entity for reporting purposes? Cheers Martyn
Daniel Dekel Posted March 14, 2018 Posted March 14, 2018 Got you now @Martyn Houghton, The entire panel is a plug-in from Timesheet Manager app and the Service Manager doe snot have that data. I can show you how that query works, but it will have to be a JOIN probably to get that Total Time. Let me know. Thanks, Daniel.
Martyn Houghton Posted March 14, 2018 Author Posted March 14, 2018 @Daniel Dekel If you can let me know the query that would be a great help. Cheers Martyn
Daniel Dekel Posted March 14, 2018 Posted March 14, 2018 @Martyn Houghton, the query: SELECT SUM(val.h_minutes) as sum FROM h_timesheet_values val WHERE val.h_related_urn='urn:sys:entity:com.hornbill.servicemanager:Requests:PM00000048' * PM00000048 is the Request ID That should give you the amount of minutes that were spent on that specific request. Hope that helps. Daniel.
Martyn Houghton Posted March 15, 2018 Author Posted March 15, 2018 @Daniel Dekel That's great. Thanks Martyn
Martyn Houghton Posted March 15, 2018 Author Posted March 15, 2018 @Daniel Dekel Just tweaked the SQL a bit and re-posting for others in the future, where you want to report on multiple requests and group the totals. SELECT h_related_urn,SUM(val.h_minutes) as sum FROM h_timesheet_values val WHERE val.h_related_urn in ('urn:sys:entity:com.hornbill.servicemanager:Requests:IDXIN00048750', 'urn:sys:entity:com.hornbill.servicemanager:Requests:IDXIN00050908', 'urn:sys:entity:com.hornbill.servicemanager:Requests:IDXIN00051329', 'urn:sys:entity:com.hornbill.servicemanager:Requests:IDXIN00050713') Group by h_related_urn Cheers Martyn
Martyn Houghton Posted March 15, 2018 Author Posted March 15, 2018 @Daniel Dekel Just to confirm units are in minutes? Cheers Martyn
Daniel Dekel Posted March 15, 2018 Posted March 15, 2018 @Martyn Houghton that would work, yes. units are in minutes. Daniel.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now