- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 05:03 AM
Vancouver Patch 8
How are the daily hours in the Time Sheet section of the time card portal calculated? What is included here? It doesn't appear that this always matches what is shown in the time sheet breakdown section or in the the logged time cards section.
For example, we have a user who submitted a time sheet with 40 hrs for last week but the info in the time sheet section shows less than 40 hrs. The time sheet breakdown show only 27 hours but the total for project tasks (33.5) and catalog tasks (6.5) is 40.
The documentation indicates that this displays the total number of tasks and hours entered for each day in the week. The total number of tasks is correct but the hours are not. The missing 13 hours on this time sheet were all logged to a project task where the user is an additional assignee.
See below:
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 09:16 AM - edited 05-06-2024 09:19 AM
Ok, we can rule the domain separation out. Thank you for confirming the values.
Time cards are associated with a time sheet with this business rule:
[your instance].service-now.com/sys_script.do?sys_id=1a6e3e409350220064f572edb67ffbf0
"Associate time card to time sheet"
This part seems to work fine, it is not responsible of updating the values on time sheet, we don't need to investigate it.
The after insert/delete (order 300) BR which updates time sheet when time card is inserted or deleted:
[your instance].service-now.com/sys_script.do?sys_id=d7edc54347031200b3207eaecb9a71a5
"Rollup hours fields on Create/Delete"
And the BR that updates time sheet on update (after update, order 300):
[your instance].service-now.com/sys_script.do?sys_id=ba7d8fd747031200b3207eaecb9a7125
"Rollup hours fields on update"
These BRs are failing in some scenarios. Please confirm the following:
- business rules exist and are active
- Business rules are OOB
- If 1 and 2 are passed, check for any custom business rules in table time_card. Search script field for "current.setWorkflow" to find if any of them is causing the BRs down the line to not trigger
For example, if there's a business rule that triggers after update, order 200 and the script contains row "current.setWorkflow(false);" this would prevent the after business rules of order >200 from triggering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 07:10 AM
this appears to have happened because of the way the user added their hours for that project task... they went to the project task record and added their time on the time card tab... so it appears that the daily totals and the total hours for the time sheet only include hours for time cards added via the time sheet portal.
is this correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 08:22 AM
All the time cards should be associated with the time sheet. The only way I can think of something like this happening OOB is from domain separation.
If I read the OOB code correctly, the 27h (and the daily values totalling to 27h) both come directly from the values in current time_sheet record, but the data in the treemap (33.5h + 6.5h) is fetched by querying all the time cards where the field "time_sheet" is referencing to the current time sheet.
This implies that all the time cards have the correct reference to Time Sheet, but the Time Sheet's values are not getting updated.
Could you confirm this by querying the user's Time Cards and adding the field "Time sheet" to the list view? If I'm right, you should find that all the time cards (for the user+week) have a value in "Time sheet" and the sum of "Total" is 40. Then you can click the reference to the Time Sheet record and observe the total found there, it should be 27h.
The discrepancy isn't expected behaviour but if you can confirm the above we're one step closer to solving your problem. Could you also confirm if your instance has domain separation activated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 08:35 AM
as far as i can tell we do not have domain separation activated... i am not sure how to check this but i went to plugins and searched for domain separation... it indicates that this plugin is not installed
all time cards for the user+week have a value in "Time Sheet" and the sum of "Total" is 40
when i click the reference to the Time Sheet record 27 is displayed for total hours
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 09:16 AM - edited 05-06-2024 09:19 AM
Ok, we can rule the domain separation out. Thank you for confirming the values.
Time cards are associated with a time sheet with this business rule:
[your instance].service-now.com/sys_script.do?sys_id=1a6e3e409350220064f572edb67ffbf0
"Associate time card to time sheet"
This part seems to work fine, it is not responsible of updating the values on time sheet, we don't need to investigate it.
The after insert/delete (order 300) BR which updates time sheet when time card is inserted or deleted:
[your instance].service-now.com/sys_script.do?sys_id=d7edc54347031200b3207eaecb9a71a5
"Rollup hours fields on Create/Delete"
And the BR that updates time sheet on update (after update, order 300):
[your instance].service-now.com/sys_script.do?sys_id=ba7d8fd747031200b3207eaecb9a7125
"Rollup hours fields on update"
These BRs are failing in some scenarios. Please confirm the following:
- business rules exist and are active
- Business rules are OOB
- If 1 and 2 are passed, check for any custom business rules in table time_card. Search script field for "current.setWorkflow" to find if any of them is causing the BRs down the line to not trigger
For example, if there's a business rule that triggers after update, order 200 and the script contains row "current.setWorkflow(false);" this would prevent the after business rules of order >200 from triggering.