Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change Request approved then only the change task rest api business rule will triggered

lalit-sharma
Tera Contributor

lalitsharma_0-1740452811831.png



try {
          var r = new sn_ws.RESTMessageV2('Rest message Name', 'Method');
        
var body = {};//Json Format
 
        gs.addInfoMessage("Body:" + body);
 
        r.setRequestBody(body);
 
        r.setHttpTimeout(5000);
        r.setRequestBody(body);
        var response = r.execute();
        var responseBody = response.getBody();
        var httpStatus = response.getStatusCode();
        var parse = JSON.parse(responseBody);
var getvalue = parse.result.u_vendor_ticket_number;
current.u_vendor_ticket_number = getvalue;
current.update();
} catch (ex) {
        var message = ex.message;
        gs.log(message);
    }
0 REPLIES 0