- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 03:49 AM
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" ?
Thanks
NR
Solved! Go to Solution.
- Labels:
-
Project Portfolio Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 07:23 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 04:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 05:52 AM
Hi Ashutosh ,
Thanks for the quick response .
I have commented the unwanted tables names in Server Script in "Time card portal - Task Selector".
when i click on "Generate Time Cards" , now i don't see other categories . ( working as expected )
But still i am able to add the unwanted categories by clicking on "Add unassigned tasks to timesheet" , please find the below screen shot highlighted in yellow where it allowed me to add Stories & Project
How to restrict this option ?
Thanks
NR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 06:08 AM
HI,
You have to do adjustment in add-task-modal angularTemplate.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 07:23 AM
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