Hi
I have a webapi code which closes the incident. This code works fine for me(Admin). But this does not work for other user. I was looking for CloseIncident enttity but did not find. Do I need to give access to any entity?
var incidentresolution = {
"subject": "The case is closed",
"incidentid@odata.bind": "/incidents(71b8a9fe-6a67-4d85-96d2-574ab34a2802)",
"timespent": 0,//This is billable time in minutes
"description": "Additional Description Here"
};
var parameters = {
"IncidentResolution": incidentresolution,
"Status": -1
};
var url = "XXXXXX" ;
var req = new XMLHttpRequest();
req.open("POST", url + "/api/data/v9.1/CloseIncident", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204) {
//Success - No Return Data - Do Something
} else {
var errorText = this.responseText;
//Error and errorText variable contains an error - do something with it
}
}
};
req.send(JSON.stringify(parameters));
Thank you