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

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: Error while closing incident in D365 Online

    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.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Error while closing incident in D365 Online

    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?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans