<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create a workflow that gets event details in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Create-a-workflow-that-gets-event-details/m-p/214790#M99</link>
    <description>&lt;P&gt;I am creating a workflow that gets event details. It's very simple, here is the diagram and this is the code:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;Simplified coding:&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import { problemsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ execution_id }) {
// get event context
var exec_req = await fetch(`/platform/automation/v0.1/executions/${execution_id}`)
var execution_obj = await exec_req.json()

return execution_obj
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Advanced coding:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import { problemsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ execution_id }) {
    // get event context
    var exec_req = await fetch(`/platform/automation/v0.1/executions/${execution_id}`)
    var execution_obj = await exec_req.json()

    // get problem
    console.log("Loading Problem details...")
    var event = execution_obj.params.event
    var problem_request = { problemId: event['display_id'] }
    var problem = await problemsClient.getProblem(problem_request)
    console.log(`Problem ${problem.displayId}`)

    return problem
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an example, I have looked at an image you have posted on the Dynatrace website, because in the documentation I can't find anything about how to capture these events from a workflow.&lt;/P&gt;
&lt;P&gt;My problem is that even though the &lt;STRONG&gt;execution_id&lt;/STRONG&gt;&amp;nbsp;of the previous run gets it right, then it tells me that the object is empty --&amp;gt;&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;execution_obj&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;params&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could someone help me with this issue? where is there documentation on this issue and how to process a previous event? Thank you very much&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Bonus:&lt;/STRONG&gt; I tested with this code example, adding the event id by hand, and it works perfectly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import { problemsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ execution_id }) {
    // get problem
    console.log("Loading Problem details...")
    var problem_id = "-123456789V2"
    var problem_request = {problemId: problem_id}
    var problem = await problemsClient.getProblem(problem_request)
    console.log(`Problem ${problem.displayId}`)

    return problem
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2023 06:37:50 GMT</pubDate>
    <dc:creator>Duran_Narbona</dc:creator>
    <dc:date>2023-06-19T06:37:50Z</dc:date>
    <item>
      <title>Create a workflow that gets event details</title>
      <link>https://community.dynatrace.com/t5/Automations/Create-a-workflow-that-gets-event-details/m-p/214790#M99</link>
      <description>&lt;P&gt;I am creating a workflow that gets event details. It's very simple, here is the diagram and this is the code:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;Simplified coding:&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import { problemsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ execution_id }) {
// get event context
var exec_req = await fetch(`/platform/automation/v0.1/executions/${execution_id}`)
var execution_obj = await exec_req.json()

return execution_obj
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Advanced coding:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import { problemsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ execution_id }) {
    // get event context
    var exec_req = await fetch(`/platform/automation/v0.1/executions/${execution_id}`)
    var execution_obj = await exec_req.json()

    // get problem
    console.log("Loading Problem details...")
    var event = execution_obj.params.event
    var problem_request = { problemId: event['display_id'] }
    var problem = await problemsClient.getProblem(problem_request)
    console.log(`Problem ${problem.displayId}`)

    return problem
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an example, I have looked at an image you have posted on the Dynatrace website, because in the documentation I can't find anything about how to capture these events from a workflow.&lt;/P&gt;
&lt;P&gt;My problem is that even though the &lt;STRONG&gt;execution_id&lt;/STRONG&gt;&amp;nbsp;of the previous run gets it right, then it tells me that the object is empty --&amp;gt;&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;execution_obj&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;params&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could someone help me with this issue? where is there documentation on this issue and how to process a previous event? Thank you very much&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Bonus:&lt;/STRONG&gt; I tested with this code example, adding the event id by hand, and it works perfectly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import { problemsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function ({ execution_id }) {
    // get problem
    console.log("Loading Problem details...")
    var problem_id = "-123456789V2"
    var problem_request = {problemId: problem_id}
    var problem = await problemsClient.getProblem(problem_request)
    console.log(`Problem ${problem.displayId}`)

    return problem
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 06:37:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Create-a-workflow-that-gets-event-details/m-p/214790#M99</guid>
      <dc:creator>Duran_Narbona</dc:creator>
      <dc:date>2023-06-19T06:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create a workflow that gets event details</title>
      <link>https://community.dynatrace.com/t5/Automations/Create-a-workflow-that-gets-event-details/m-p/214956#M100</link>
      <description>&lt;P&gt;Is working:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var exec_req = await fetch(`/platform/automation/v1/executions/${execution_id}`)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the version is &lt;STRONG&gt;v1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 11:20:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Create-a-workflow-that-gets-event-details/m-p/214956#M100</guid>
      <dc:creator>Duran_Narbona</dc:creator>
      <dc:date>2023-06-14T11:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a workflow that gets event details</title>
      <link>https://community.dynatrace.com/t5/Automations/Create-a-workflow-that-gets-event-details/m-p/215193#M101</link>
      <description>&lt;P&gt;Typo:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var problem_request = { problemId: event['event.id'] }&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 Jun 2023 11:27:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Create-a-workflow-that-gets-event-details/m-p/215193#M101</guid>
      <dc:creator>Duran_Narbona</dc:creator>
      <dc:date>2023-06-16T11:27:04Z</dc:date>
    </item>
  </channel>
</rss>

