web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Error while closing incident in D365 Online

(0) ShareShare
ReportReport
Posted on by 170

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

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    In order to understand what goes wrong it would be great to get an error that you experience. Can you please provide text of the error?

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Please check below privilege for closeincident action. See if user has below permissions.

    The following table lists the privileges needed for the CloseIncidentRequest message. The exact set of privileges needed depends on the entity types specified in the request.

    Primary Entity - incident

    Privilege

    prvCreateActivity

    prvAppendToIncident

    prvAppendActivity

    prvWriteIncident

    prvDeleteQueueItem

    prvReadActivity

    prvWriteActivity

    If found helpful, Please mark my answer verified.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 142 Super User 2026 Season 1

#2
ManoVerse Profile Picture

ManoVerse 131 Super User 2026 Season 1

#3
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans