Resolution Field Handling in Closure Rule

Resolution Field Handling in Closure Rule

Configure the Request Timer actions as per the below steps which is to automatically add the resolution and then close the request if there is no response.

1. Configure the condition as provided in the below image.


2. In the stage 1, configure After rules to send reminder notifications to get the required inputs.


3. Next, under the stage 2, configure During rules with the below custom function under Admin > Request Custom function.

Script:

Note: Please update the global function value as per your configuration

configuration = global_function_7();
returnObj = Map();
instanceJson = context.get("instance");
helpdeskID = instanceJson.get("id");
requestid = requestObj.get("id");
headers = {"authtoken":configuration.get("technicianKey"),"PORTALID":helpdeskID};
url = configuration.get('url') + "/api/v3/requests/"+requestid;
headers= {"authtoken":configuration.get("technicianKey"),"portalid":helpdeskID};
input_data = {"request": {"resolution": {"content": "Closing Request due to no response on approval"}}};
response = invokeurl
[
url: url
type: PUT
parameters: {"input_data":input_data}
headers: headers
];
info response;
if ( response.get('response_status').get('status') == 'success'){
returnObj.insert("result":"Success");
returnObj.insert("message":"Status updated");
return returnObj;
}
else{
returnObj.insert("result":"Failed");
returnObj.insert("message":"Status update failed");
return returnObj;
}
return returnObj;

During rule condition:



3. Next, in the stage 3, use the actions to update the status to required completed status.


The provided steps is working fine on my end where the resolution is getting added and then the request is closed without any issues. Below is my history screenshot where it indicates that the script is working fine without any issues.






    • Related Articles

    • Time Elapsed not avavilble on the Matrix report || Known issue at 15130 build || SD-136533

      Dear Team, Our client GCA is encountering an issue regarding the matrix reports, where the Time Elapsed column is not fetching and is not available as a selection when you try to create, so we referred to the support team, and after investigation, ...
    • Hide "New Request" Buttons via Custom Page Scripts

      Purpose To hide specific "New" request buttons from the user interface using custom scripts to streamline the layout or control how users initiate requests. Implementation Options These scripts can be used independently or combined, depending on ...
    • Instant Task Deployment Fails with “Invalid Authentication Passcode” - OS Deployment

      Problem Description: A client encountered a deployment failure when using an Instant Task to deploy an OS image over the network. The error displayed: Invalid authentication passcode. Observations: The authentication passcode has been verified as ...
    • Change Lock Screen Image

      Purpose This solution explains how to change the Windows lock screen image on managed devices using EPC custom script deployment. The process includes: Preparing the lock screen image Uploading the required script Configuring the deployment settings ...
    • Service Desk services stopped on its own.

      The reason for the crash is becauss the SQL database connectivity was lost. It's looks like this while checking the log file : [15:54:58:066]|[10-11-2018]|[SYSERR]|[INFO]|[72]: 101603933 [ServiceDeskCommon-2] WARN tm.TransactionImpl - XAException: ...