Comments

@Ashish Nahar Nice Article. It would be helpful if you update article with hyperlinks. All the links added are as text. Please use hyperlink option to add links.

find_real_file.png

 

Thanks,

Anil Lande

Thank you for this. Pretty new to writing articles 🙂

hi Ashish, how did u manage to update the variables? I've wrote below script but the variable is not updating even if the request is successful, tried POST/PUT/PATCH

 

 

(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
    var pathParams = request.pathParams;
    var obj = pathParams.number; // [false] 
    var ritm = new GlideRecord("sc_req_item");

    var reqbody = request.body;
    var reqdata = reqbody.data;

    if (obj && obj != '') {
        ritm.addQuery("number", obj);
        ritm.query();
        if (ritm.next()) {
            ritm.variables.u_name = reqdata.variables.mgmt;
            ritm.work_notes = "owrk"; //Parameter means the key in JSON
			ritm.update();
        }
    }

})(request, response);

 

 

@John Andre See  Apologies, i have been away from the community for quite some time now. Reaching out if you got all you wanted or need some other help.

Version history
Last update:
‎02-09-2022 05:01 AM
Updated by: