# Missing Management Zone in Davis event trigger

**URL:** <https://community.dynatrace.com/t/missing-management-zone-in-davis-event-trigger/49610>\
**Category:** Automations\
**Tags:** workflows, automations\
**Created:** [January 8, 2025, 12:09pm UTC](https://community.dynatrace.com/t/missing-management-zone-in-davis-event-trigger/49610 "2025-01-08T12:09:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [January 8, 2025, 12:09pm UTC](https://community.dynatrace.com/t/missing-management-zone-in-davis-event-trigger/49610/1 "2025-01-08T12:09:44Z")

</div>

![henk_stobbe_0-1736338071325.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/3/93aa9466b71c31b213fe61165d8a51da565a17f0.png)

Hello, am I missing a MZ selection or is there a TAG I can use instead. Could also be that this is all and the rest is up to the workflow?

KR Henk

---

<div class="post-metadata">

**Author:** ![christian\_kreuz](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_kreuz/32/21669_2.png) [@christian\_kreuz](https://community.dynatrace.com/u/christian_kreuz)\
**Post date:** [January 10, 2025, 7:12am UTC](https://community.dynatrace.com/t/missing-management-zone-in-davis-event-trigger/49610/2 "2025-01-10T07:12:16Z")

</div>

Unfortunately, Management Zone Filtering is not available for (Davis) Event Triggers in Workflows.

If you already know that you’re looking for a specific tag, that would be an option.

If not, filtering should be doable in a follow-up task within the same Workflow with a DQL task (or maybe using “Run JavaScript”). Please have a look at [https://community.dynatrace.com/t5/Dashboarding/Filter-by-Management-Zone-using-DQL/m-p/232272/highlight/true#M3548](https://community.dynatrace.com/post/232272) for inspiration.

---

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [January 10, 2025, 9:00am UTC](https://community.dynatrace.com/t/missing-management-zone-in-davis-event-trigger/49610/3 "2025-01-10T09:00:06Z")

</div>

//i Christian thanks for your reply maybe below code can help someone else

//Based on effected entities, and returning ManagementZone if found in any

import { monitoredEntitiesClient } from “@dynatrace-sdk/client-classic-environment-v2”;  
import { execution } from ‘@dynatrace-sdk/automation-utils’;

export default async function ({ execution\_id }) {  
const filterMZ = “\*\*\*Fill in MZ name to filter\*\*\*”;  
const ex = await execution(execution\_id);  
const eventData = ex.event();  
console.log(eventData);  
// Extracting entities from event  
for (const My\_entity of eventData.affected\_entity\_ids) {  
console.log(`Processing element: ${My_entity}`);  
try {  
// Retrieve entity data from Dynatrace  
let entityData = await monitoredEntitiesClient.getEntity({  
entityId: My\_entity  
});

// Check if any management zone has the specific name  
for (const zone of entityData.managementZones) {  
console.log(zone.name);  
if (zone.name === filterMZ) {  
return filterMZ;  
}  
}  
} catch (error) {  
console.error(`Failed to retrieve data for element: ${My_entity}`, error);  
}  
}

return “”;  
}
