Why incidents getting created twice with same number & other all fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 06:15 AM
Hi Community,
I have spent so many time in this but still not able to get why this is happening. All fields value are same but difference is in time stamp.
Following things I checked:-
1.Inbound Email Actions(which is not there for incident)
2.Insert & Stay UI Action(which is not there for incident)
3.Checked activity logs (seems to be fine)
Compared History Calendar for this two records. But it's weird, details for one record is empty for one of the user updates while for other record, history seems to be the fine. Is this the issue with duplicate incidents? I'm not sure.
Any response is appreciated .Attached is the screenshot.
Thanks,
Ankita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 06:50 AM
Can you check for the "created by" who has created these incident?
Is there any integration that has created incident in your system?
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 07:02 AM
Hi Prince,
Thanks for your response.
Both records were created by same user. I don't think it is created by integration.
User is the end user & he might have created it from portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 08:16 AM
Please check whether any business rule is attached with the incident table with "current.update()" operation, please follow the step:
Please check the business rules, whether it is creating the duplicate records.
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 11:15 AM - edited 03-19-2023 11:18 AM
Yes, we have an insert/update after BR (without any condition) which has current.update() code. That's might be the reason for duplicate incident creation.But the same BR working fine in dev environment. It's working fine & creating single incident only.Also in prod, other *incidents are with unique number except this one so not sure what's the exact issue.
Does current.update() not cause issues everytime?
Below is the BR:-
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var bu = "";
var ag_split = "";
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', current.u_requested_for);
gr.query();
if (gr.next()) {
var grc = new GlideRecord('core_company');
grc.get(gr.company);
var ag = grc.u_ag_split;
bu = grc.getValue('u_bu');
var grAG = new GlideRecord('u_ag_split');
grAG.addQuery('u_ag_split', ag);
grAG.query();
if (grAG.next()) {
ag_split = grAG.getUniqueValue();
}
}
if (ag_split != current.u_ag_split) {
current.u_ag_split = ag_split;
current.update();
}
if (bu != current.u_serving_bu) {
current.u_serving_bu = bu;
current.update();
}
})(current, previous);