My Items in ESC Portal not showing the count

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 03:59 AM
In my esc portal under "My Items" tab I have three different sub-tabs:
1. Tickets
2. Approvals
3. Tasks
In the below picture you can see that Tickets and Approvals show a count whereas Tasks doesn't, how do I make it work.
JSON:
{
"tabs":[
{
"title":"${Tickets}",
"widget_id":"nr-mini-myitems",
"badge_prop": "tickets_count",
"options": {
"limit": 4,
"script_include":"3e7593421b69e110103355bf034bcbf7",
"template": "nr-lp-tickets-list-v2.html"
}
},
{
"title":"${Approvals}",
"widget_id":"nr-approvals-list",
"badge_prop": "approvals_count",
"options": {
"limit": 2,
"script_include": "3e7593421b69e110103355bf034bcbf7",
"method_name": "getApprovals",
"template": "nr-lp-approvals-list-v2.html"
}
},
{
"title":"${Tasks}",
"widget_id":"nr-mini-myitems",
"badge_prop": "todos_count",
"options": {
"limit": 4,
"script_include":"3e7593421b69e110103355bf034bcbf7",
"method_name": "getTodos",
"template": "nr-lp-todos-list-v2.html"
}
}
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The reason your Tasks tab is not showing a count is because the badge_prop is set to todos_count, but your getTodos method in the script include is likely not returning this property. For Tickets and Approvals, the script include methods return tickets_count and approvals_count, which match the badge properties, so the counts appear correctly. To fix this, you need to update the getTodos method to return a JSON response that includes todos_count, for example by adding todos_count: todosArray.length along with the tasks list. Once the property name in the response matches the badge_prop in your widget configuration, the count will display properly. This change is safe and upgrade-proof since you are only extending your custom script include logic.
if this is not the solution please — please provide the full details or describe the issue in detail with a screenshot.