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

Notifications

Announcements

No record found.

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,983 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans