GetSumOfTimesheetReportHoursForGivenPeriod Function
GetSumOfTimesheetReportHoursForGivenPeriod (user as ObjectIdentifier, from as DateTime, to as DateTime, state1 as ObjectIdentifier, state2 as ObjectIdentifier, ... as ObjectIdentifier) as Duration
Category: | Date |
Description: | Returns the the sum total duration of reported timesheets for the specified user. Where the "user" argument can be a specific user or a reference to user field, and "dateTime1" and "dateTime2" arguments are used to determine the period. The "state" argument is optional and by default will return reported hours for timesheets in all states. |
Supported Context: | BusinessRules |
Parameters: | |
user as ObjectIdentifier(User) | Represents a reference to a user object or a field that returns a user object |
from as DateTime | Represents a reference to a from date or field that returns a date value |
to as DateTime | Represents a reference to a to date or field that returns a date value |
state1 as ObjectIdentifier(State) |
An optional parameter that represents the state of work items for which you would like to get reported hours, this parameter can be repeated for each work item state, or left as null for work items in state "draft" and "active"
|
state2 as ObjectIdentifier(State) |
An optional parameter that represents the state of work items for which you would like to get reported hours, this parameter can be repeated for each work item state
|
... as ObjectIdentifier(State) |
An optional parameter that represents the state of work items for which you would like to get reported hours, this parameter can be repeated for each work item state
|
Returned value as Duration | Returns a duration value equal to the total number of reported hours for the user specified in the "user" parameter for the date range specified in the "from" and "to" parameters for the work items in the given states specified in the "statex" parameters |
Example #1 |
GetSumOfTimesheetReportHoursForGivenPeriod(currentuser(),$WorkItem.StartDate,$WorkItem.DueDate) |
Tips | This function has a parameter from type pick list that may have being customized by your organization. Please refer to the pick list values in the formula helper editor or view the values within the relevant field. |