28 Aug 2023 09:28 AM
What if the Trigger is event Trigger, for example Davis problem trigger. How do i get the problem ID that trigger this?
Solved! Go to Solution.
28 Aug 2023 09:35 AM - edited 28 Aug 2023 09:35 AM
Hi @william_cher,
You can access the event payload and its attributes through {{ event() }} expression.
For example:
{{ event()["event.id"] }}
28 Aug 2023 09:55 AM
Hi @michal_zawislak ,
Thanks for your reply. How do I access this information in Javascript?
As im running a custom Javascript after the Trigger.
28 Aug 2023 10:01 AM - edited 28 Aug 2023 10:02 AM
The "Run Javascript" action is a bit different as it's not allowed to use expressions there due to security concerns. Instead of expressions, you can use automation-utils SDK to get event payload and then navigate to the attribute using JavaScript syntax.
import { execution } from '@dynatrace-sdk/automation-utils'; export default async function ({ execution_id }) { const exe = await execution(execution_id); const eventContext = exe.event(); const eventId = eventContext['event.id'] }
I hope this will help.
11 Jan 2024 03:55 PM
I was struggling with that as well...
Adding a Custom JS step to extract the impacted entity IDs from a problem to get entity NAMES so that a Teams notification is more meaningful...
But HOW (and where) can we find such internal code api documentation? I'm really struggling getting examples on what APIs exist....
12 Jan 2024 09:20 AM
You can find examples and available SDKs/APIs in the documentation: https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference