prevent autoresolving incidents from dynatrace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2022 09:27 AM
Hi,
I am trying to prevent autoclose the incidents from dynatrace when problem title contains "P1_CRITICAL'. Currently all incidents will be created and autoclose from dynatrace alerts. Now we want to exclude auto-closing when ever problem title contains 'P1_critical' and it should stay in open state and all other incidents without 'P1_Critical' should still autoclose. I updated the transform map and its not working. Please help
answer = (function transformEntry(source) {
if ((source.problem_state == "OPEN") && (source.problem_title == 'P1_CRITICAL')) {
return 1;
} else {
// do not update the existing problem state if user disabled autoresolve incidents
if (gs.getProperty('x_dynat_ruxit.autoresolveproblems') == 'true') {
return 6;
} else {
return 1;
}
}
})(source);
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2022 10:06 AM
You say that the problem title contains "P1_CRITICAL" but you code it looking for it to equal "P1_CRITICAL". If the problem title has more then P1_CRITIAL in it you want to do (source.problem_title.indexOf("P1_CRITICAL") > -1))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2022 08:43 AM
Hi,
I have tried "(source.problem_title.indexOf("P1_CRITICAL") > -1))" its not working and still incidents are automatically getting resolved.
answer = (function transformEntry(source) {
if ((source.problem_state == "OPEN") &&(source.problem_title.indexOf("P1_CRITICAL") > -1)) {
return 1;
} else {
// do not update the existing problem state if user disabled autoresolve incidents
if (gs.getProperty('x_dynat_ruxit.autoresolveproblems') == 'true') {
return 6;
} else {
return 1;
}
}
})(source);
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2022 09:04 AM
So your importing a problem from another source. Then your are auto closing it. What triggers the auto close? Is it done by the import or something else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2022 09:13 AM
Yes, its importing from Dynatrace tool. It will close the incident based on Problem_state is CLOSE
Thanks,