Rest API Update Incident Status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2015 09:34 AM
I'm trying to update that status of an incident and was wondering if the rest call is correct? (using C# RestSharp)
public void UpdateIncidentStatus(string incidentNumber, string newStatus)
{
var request = new RestRequest("/api/now/table/incident?sysparm_query=number={incident_number}", Method.PUT) { RequestFormat = DataFormat.Json };
request.AddParameter("incident_number", incidentNumber, ParameterType.UrlSegment);
request.AddBody(new { status = newStatus }); // uses JsonSerializer
var response = client.Execute<RootObject>(request);
if (response.StatusCode == HttpStatusCode.NotFound)
throw new Exception(response.ErrorMessage);
}
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2015 09:24 AM
I updated the discussion and you should now see the options to mark replies as "correct" and "helpful"
Cheers,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 05:51 AM
I'm working on the similar requirement. Can you share the business rule for update scenario, how are you checking if the incident already exists in another instance?