prevent autoresolving incidents from dynatrace

reddy8055
Tera Contributor

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,

7 REPLIES 7

Brian Lancaster
Tera Sage

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))

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,

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?

Yes, its importing from Dynatrace tool. It will close the incident based on Problem_state is CLOSE

 

Thanks,