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-15-2015 04:16 AM
Hi Jason,
Please mark the reply as answer, if you feel it is answered. It adds value to the community members and encourages them to help the community.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2015 06:34 AM
Hmm.. for some strange reason, this posting does not allow me to mark as answered. There are no buttons that says "correct answer" that allows me to mark the reply as the correct answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2015 09:45 AM
I just figured out that when creating a discussion I did not mark the checkbox stating it was a question so that is why I'm not seeing those buttons to mark a reply as an answer. I'll do this in future discussions/quesions moving forward.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2015 07:50 PM
We can get that changed. bianca.vaccarini, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2015 09:18 AM
Yes Dan Bruhn can make that adjustment