0

How to close the task using Service Now Rest API in automation anywhere? I need to close the ticket using RestAPI could you please help me out.

Megha D Gowda
  • 11
  • 2
  • 3

2 Answers2

2

Using the REST API Explorer, select Modify a record (PUT), table name incident, and the sys_id of the ticket.

The body needs 3 fields:

{
  "state":"7",
  "close_code":"Closed/Resolved by Caller",
  "close_notes":"blabla"
}

close_code (also called Resolution code in the UI) is mandatory. For the admissible values, in the UI navigate to System Definition / Choice Lists, and search for table incident, element close_code.

close_notes (also called Resolution notes in the UI) is mandatory, but it's free text.

state is either 6 for Resolved, or 7 for Closed.

joao
  • 2,220
  • 2
  • 11
  • 15
1

After scouring the forums and trying different solutions I was finally able to successfully close the issue ticket by using a patch request with these parameters. Using the Table api endpoint for the UTAH release,

https://<instance>.service-now.com/api/now/v1/table/incident/{incident_id}'
    resolve = \
        {
            "close_code": "Closed/Resolved By Caller",
            "incident_state": "7",
            "caller_id": "admin",
            "close_notes": "Closed by API"
        }
sebcampos
  • 52
  • 4