- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ‎11-26-2020 11:37 PM
OOB Time Sheet Portal shows all the task records present in tasks table. If we want to modify the OOB behaviour to show desired task type, we need to update in two widgets.
Task pane
If you wish to add more tables or remove OOB task types to show in Task tab (in left pane), then follow below steps:
- Navigate to Service portal -> widgets from module.
- Search for record with ID : timecard-portal-container (Time Card Portal Main Container).
- Search in Server Script -> data.taskSelector = $sp.getWidget('timecard-task-selector'
- You can see a list of tables mentioned there. You can modify the list to show expected tasks ( OOB there is no widget input present, but if you have already some inputs, then this modification of tasks will get skipped).
Task selector
If you wish to add/remove specific task types from the task selector dropdown, i.e. Add unassigned tasks to Time Sheet, follow below steps.
- Navigate to Service portal -> widgets from module.
- Search for record with ID : tc-grid (Time Card Grid).
- Search in Server Script -> var taskSelector = $('#task-selector');
- The select2 component is using OOB Table rest api to fetch records from task table, i.e. url: '/api/now/table/task'
- You can create your own Rest api to fetch specific records and replace the url here OR
- Extend the OOB Table rest api to query specific records. https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_TableAPI
N.B.:
- This is completely a customisation, so while upgrading instance version it needs special attention to get updated version along with this customisation.
- Adding many task types, may cause performance degradation of Time Sheet Portal. Querying to a huge number of records, will delay the page load/operations.
- 4,003 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi,
I am hoping there must be similar way of updating what information we see about the tasks on the task selector widget. Like as of now we see a task state, priority, updated date and title. What if I want to see more information there so I can take a more informed decision there. I would like to add a custom field value there. Could you please guide me with the same?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
You can edit Service portal widget 'Time Card Portal - Task Selector' to update the task selector cards layout.
In server script, you can see defaultLayout , which contains primary fields, secondary fields ect. You can add your custom field in the secondary_fields array. it will show up in the card layout.
In Body HTML template, you can search for class="card" for the structure of layout.
Hope this help you.
regards,
Jayarnab
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Jayarnab,
I did try adding the field in the secondary fields array but it broke the portal.
Would it be possible for you to share an example here?
Also, what if there is a different field for Demand which I want to add and that doesn't not exist on project. Are there separate places to define as per the task type?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi
I want to restrict what tasks I see in the "Add unassigned task" and was following the steps you mentioned but as mentioned in step 3.
I didn't find anything like "taskSelector"
Search in Server Script -> var taskSelector = $('#task-selector');
Can you please suggest?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I am also trying to update the task pane view and followed the steps but wasn't able to move forward step 3 and 4 as I don't see list of tables in the server script.
- Search in Server Script -> data.taskSelector = $sp.getWidget('timecard-task-selector'
- You can see a list of tables mentioned there. You can modify the list to show expected tasks ( OOB there is no widget input present, but if you have already some inputs, then this modification of tasks will get skipped).
Below is what I see.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi
I am trying to follow the steps you mentioned but not ale to find the points listed.
If you wish to add/remove specific task types from the task selector dropdown, i.e. Add unassigned tasks to Time Sheet, follow below steps.
- Navigate to Service portal -> widgets from module.
- Search for record with ID : tc-grid (Time Card Grid).
- Search in Server Script -> var taskSelector = $('#task-selector'); NOT FOUND
There isn't anything like taskselector I could see either in my PDI or client instance. - The select2 component is using OOB Table rest api to fetch records from task table, i.e. url: '/api/now/table/task'
- You can create your own Rest api to fetch specific records and replace the url here OR
- Extend the OOB Table rest api to query specific
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Do you have any update on the question asked by Chandler?
I too have the same issue. Can you please help.
- Thank you.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Yes, same for me.
Did anything resolve your issue?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
You want to look at defaultTables/tables in 2 separate locations:
1. In the Time Card Portal - Task Selector Widget about a quarter of the way down you should see this:
2. The Widget Instance titled "Time Card Portal Container"
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @HazzN ,
We are in Tokyo version and I need to hide tasks from specific tables under both tasks tab and also from ' Add unassigned Tasks to Timesheet option.
I made changes in Time Card Portal - Task Selector Widget , now its is working fine under Tasks tab.
But from 'Add unassigned Tasks to Timesheet' . I can still see records from all tables.
How to fix it? Please help.
Thanks,
Talya
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Is there a way to restrict the record types that are generated from the 'generate time cards' button? We only want to generate time cards for PRJ records, and I'd like to do that without having to modify some sort of script that's OOB. Wondering if there is a simpler way
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I have a requirement where I need to add 'Interactions' to time sheet portal.It isn't part of Task table.So, how can we configure that. If anyone have idea on this please help me.
Thank you!