Restrict Categories in Timesheet portal from "Generate Time Cards" option

NiKhil70
Kilo Guru

Hi ,

I have a requirement to hide all the categories  Except "Project task" under Tasks - > All Tasks in Time Sheet Portal.

It got fixed my making the changes to the Server Script in 'Time Card Portal Main Container' widget , please find the 2 nd screenshot attached.In line 33 , i have commented all the table names .In line 36 i have put only  pm_project_task table.

I don't see other tasks -> under Tasks - > All Tasks

But when i click on "Generate Time Cards" , i see all the categories are again visible under Tasks - > All Tasks.

My Requirement is to completely restrict the below categories except "Project task" .

1. Incidents
2. problems
3. Change requests
4. Stories
5. Scrum tasks
6. Test plans
7. Project task
8. Projects
9. Defects
10. Enhancements
11. sn_customerservice_case
12. wm_order
13. wm_task

How can i restrict the categories from "Generate Time Cards"  ?

find_real_file.png

find_real_file.png

Thanks 

NR

1 ACCEPTED SOLUTION

Jayarnab Saha
ServiceNow Employee
ServiceNow Employee

Hi NR,

 

"Add unassigned tasks to timesheet" has a select2 dropdown, which query to task table with ServiceNow standard table query api. Incident, Case, Project, Demand and many more tables are extended from task table, so you are able to see all type of tasks in this dropdown.

To restrict this, you need to

1. navigate Service portal -> Widget -> tc-grid (Time Card Grid).

2. Open 'link function'.

3. Search for '/api/now/table/task'.

4. Instead of 'task', you need to replace with 'pm_project_task'.

 

This will only get records from Project Task table. 

 

Hope this will help you with your requirement.

 

Thank you,

Jayarnab

View solution in original post

11 REPLIES 11

Hi NR,

I think Generate Time Cards, directly create time cards from backend. there is no option to select what type of time cards.

Where exactly are you seeing Defects?

 

As per previous workaround, that will work for "Add unassigned tasks to timesheet" and  '/api/now/table/pm_project_task' will only return records from Project Tasks.

Please check once.

Maitri Shah1
Kilo Explorer

Hello,

Nikhil i have the similar requirement i want only project task when we click on "Generate time card" . Where you able to achieve so ? if so can you share what configuration or changes you have made to achieve this ?