# Get problemID from Davis Problem Trigger in workflow

**URL:** <https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384>\
**Category:** Developer Q&A Forum\
**Tags:** workflows\
**Created:** [August 28, 2023, 8:28am UTC](https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384 "2023-08-28T08:28:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![william\_cher](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@william\_cher](https://community.dynatrace.com/u/william_cher)\
**Post date:** [August 28, 2023, 8:28am UTC](https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384/1 "2023-08-28T08:28:57Z")

</div>

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](https://global.discourse-cdn.com/dynatrace/original/3X/e/6/e6c037a0b638695087450b7ae7242f6b9ee69590.png)

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [August 28, 2023, 8:35am UTC](https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384/2 "2023-08-28T08:35:34Z")

</div>

Hi&nbsp;[@william\_cher](https://community.dynatrace.com/user/62755),

You can access the event payload and its attributes through [{{ event() }} expression](https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows/reference#event).

For example:

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

```

---

<div class="post-metadata">

**Author:** ![william\_cher](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@william\_cher](https://community.dynatrace.com/u/william_cher)\
**Post date:** [August 28, 2023, 8:55am UTC](https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384/3 "2023-08-28T08:55:37Z")

</div>

Hi [@michal\_zawislak](https://community.dynatrace.com/user/57046) ,

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

As im running a custom Javascript after the Trigger.

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [August 28, 2023, 9:01am UTC](https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384/4 "2023-08-28T09:01:19Z")

</div>

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&nbsp;[automation-utils](https://developer.dynatrace.com/reference/sdks/automation-utils/#execution-utilities-examples)&nbsp;SDK to get event payload and then navigate to the attribute using JavaScript syntax.

```auto
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.

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 11, 2024, 3:55pm UTC](https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384/5 "2024-01-11T15:55:45Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![michal\_zawislak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michal_zawislak/32/13613_2.png) [@michal\_zawislak](https://community.dynatrace.com/u/michal_zawislak)\
**Post date:** [January 12, 2024, 9:20am UTC](https://community.dynatrace.com/t/get-problemid-from-davis-problem-trigger-in-workflow/41384/6 "2024-01-12T09:20:39Z")

</div>

You can find examples and available SDKs/APIs in the documentation:&nbsp;[Jinja expressions for Workflows — Dynatrace Docs](https://docs.dynatrace.com/docs/platform-modules/automations/workflows/reference)
