- you can configure Time Management policy extension so as to add a policy. We have one that prevents resources from submitting time on Request work items that have been closed or cancelled for more than 7 days.
- you can have a script periodically run and remove any closed items from TM_RESOURCE_QUICKLIST_ITEMS which will remove them from the users' My Items lists
- first option you provided for time sheet policy settings I guess you are telling about the Project setting where under time sheet setting we have certain option to restrict time charging against requests for 7 days. Request Types like Proposal and other Demand requests do not have such time sheet setting. Kindly correct me if I am wrong.
- second option for creating the script can you please help me to know the process of creating the script and some pointers which can help me to create it.
You're correct about the project settings, but that's not what I was referring to. Look for the section on Custom Rules for Time Sheets in the Time Mgt Config Guide. It basically involves writing a SQL query to return items that time should not be permitted on, and a message to the user if they try. The rule is tested upon time sheet sumbission.
Here is my script to remove the quicklist ("My Items") items. It removes any requests that are on step "Approved" and tasks that are closed or cancelled. You'd want to adjust the logic to your requirements.
delete from TM_RESOURCE_QUICKLIST_ITEMS where resource_quicklist_item_id in ( select resource_quicklist_item_id from TM_RESOURCE_QUICKLIST_ITEMS where 1=1 and work_item_type = 'REQUEST' and kcrt_request_util.Get_Workflow_Active_Steps(work_item_id) = 'Approved' union all select resource_quicklist_item_id from TM_RESOURCE_QUICKLIST_ITEMS where 1=1 and work_item_type = 'TASK' and work_item_id in ( select t.task_id from wp_tasks t join wp_task_info i on i.task_info_id = t.task_info_id where 1=1 and i.status in (6,7) -- closed, cnxd ) )