cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get problemID from Davis Problem Trigger in workflow

william_cher
Participant

What if the Trigger is event Trigger, for example Davis problem trigger. How do i get the problem ID that trigger this?

william_cher_0-1693211221988.png

3 REPLIES 3

michal_zawislak
Dynatrace Advisor
Dynatrace Advisor

Hi @william_cher,

You can access the event payload and its attributes through {{ event() }} expression.

For example:

{{ event()["event.id"] }}

 

Your AutomationEngine ally!

Hi @michal_zawislak ,

 

Thanks for your reply. How do I access this information in Javascript?

As im running a custom Javascript after the Trigger.

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.

Your AutomationEngine ally!

Featured Posts