Web Service Consumer and Commit Changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 03:05 PM
Working on this business rule now learning but when I go to the log file after executing the updates to the required table there is no log file to confirm it is completed. What am I doing wrong?
Instance information is taken out but here is Business rule as written in the training:
(function executeRule(current, previous /*null when async*/ ) {
if (current.item_type == "cmdb_ci_computer") {
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://nowlearning-nlinst010-test-001.lab.service-now.com/api/now/table/u_password_vault?sysparm_qu...' + current.cmdb_ci.asset_tag + '&sysparm_fields=u_password&sysparm_limit=1');
request.setHttpMethod('GET');
//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = '';
request.setBasicAuth(user, password);
request.setRequestHeader("Accept", "application/json");
var response = request.execute();
gs.info(response.getBody());
var obj = JSON.parse(response.getBody());
var myPass = obj.result[0].u_password;
gs.info('u_password: ' + myPass);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 12:22 PM
Hello< I am currently having this same issue. Did you ever figure out what was going wrong for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:22 PM
No, unfortunately, I didn't and I just moved on. It was very nerve-wracking trying to figure out what went wrong.