0

I am using Node.js and var GlideRecord = require('servicenow-rest').gliderecord; for creating and updating a ticket in ServiceNow.

I am able to create a ticket through node code and getting the sys_id but I am not able to close the ticket. I am not getting any response or errors either.

Here is the code snippet:

gr = new GlideRecord("xxx", "yyy", "zzz", "aaa");
var obj2 = {
    comments: "Ticket closed",
    state: "7",

}
gr.update(sys_id, obj2).then(function (error, response) {
    console.log(response);
    console.log(error);
});

How can I solve this problem?

robbannn
  • 5,001
  • 1
  • 32
  • 47

1 Answers1

0

Have you tried the same update in the client or via a rest call without this library as I don’t see how to log the error. It’s likely there’s a abort business rule disallowing the update, however that doesn’t generally show up in the rest response.

Try setting state to 6 aka resolved. If that works look at the business rules and considering suggesting changing the logic on aborting the update to meet your need.

Jace
  • 144
  • 1
  • 9