'row_count' in API input data of Zia Bot Custom Actions script is getting removed

'row_count' in API input data of Zia Bot Custom Actions script is getting removed

Issue:
Below script is used in the Zia Bot custom Actions to view the last five requests of that respective user. This is achieved by setting the row_count property in the input_data's list_info property of API. But in Zia Bot client handling, this row_count property will be removed, because of which all latest requests will be shown in the list view.

  1. input_data = {
  2.     "list_info": {
  3.         "row_count": 5,
  4.         "start_index": 1,
  5.         "sort_field": "id",
  6.         "sort_order": "desc",
  7.         "search_criteria": {
  8.             "field": "requester",
  9. "value": context.get("userInfo").get("id"),
  10.             "condition": "="
  11.         }
  12.     }
  13. };
  14. response = invokeurl
  15. [

  16. url: "<URL>/api/v3/requests"

  17. type: GET
  18. parameters: {"input_data":input_data}
  19. headers: {"TECHNICIAN_KEY":"<Tech Key>"}
  20. ];

  21. return response;
Fix:
The row_count will not be removed for Custom Actions showing list view as response.

Instructions:

-> Go to <Installation Directory>/ServiceDesk/webapps/ROOT/scripts folder.
-> Move the servicedesk.js and servicedesk_ember.js from that folder (as a Backup)
-> Download the attached files with fix and rename the file names by removing the _txt  in the file extension and move it to the same folder.
-> Now do a hard refresh and try checking the list view from Zia Bot. It show the expected data.

Compatibility:
SDP 14.7.60 version (14760)

Modified Files:
servicedesk.js
servicedesk_ember.js

                  New to ADSelfService Plus?

                    • Related Articles

                    • What is Data Archiving ?

                      Data Archiving is a process where requests will be moved to the archived state (archived requests) and will be removed from the active requests list. In the database perspective, It will be just moved from workorder table to arc_workorder table in ...
                    • Pre-define 'Email IDs to notify' with API

                      Email ids to notify can be pre-defined while adding through v1 API. The key is "interestedParty" for the same : Please check the below example : data={ "operation": { "details": { "subject": "Cannot browse", "description": "Unable to connect to the ...
                    • Notification script using Custom function in custom trigger

                      This is applicable from 10600 builds. From 10600 , Business rules dont have Email notification feature. The same use case be achieved through Custom triggers feature as mentioned below. Script to enable notification of request creation using custom ...
                    • API -Listing Requesters with E-mail Address

                      1. Encode the below mentioned and change the highlighted as per yours: { "list_info": { "sort_field": "name", "start_index": 1, "sort_order": "asc", "row_count": "100", "get_total_count": true, "search_fields": { "email_id": "req1@msp.com" } }, ...
                    • Link Support for Zia Bot Message View Custom Function

                      Issue: Unable to show link in Zia Bot using Zia Bot's Custom Function (Message View) Fix: Link Support Provided Ex: Custom Function deluge Code: return {"display_message": "[Test Link](https://www.google.com)"}; Compatible only for 14500 ...