<?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 Re: Generating Problem  with  workflow action &amp;quot;Analyze with Davis&amp;quot; in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281221#M2268</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/85008"&gt;@Emm4nuel&lt;/a&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;I’ve added a JavaScript action, but unfortunately it’s not working. My JavaScript knowledge is a bit limited. I’ve attached the workflow JSON ,any chance to have look?&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>Thu, 10 Jul 2025 04:26:17 GMT</pubDate>
    <dc:creator>Akhil-Jayendran</dc:creator>
    <dc:date>2025-07-10T04:26:17Z</dc:date>
    <item>
      <title>Generating Problem  with  workflow action "Analyze with Davis"</title>
      <link>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281198#M2266</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently exploring the workflow capabilities for Analyze with Davis. I’ve created a simple workflow that runs every day at 05:00 AM to check for specific errors in a particular log. If the error count is 1, it should create a problem. I added an action ‘Analyze with Davis’ included my dql and set the static threshould, workflow runs successfully not getting any problem/events out of this ? Does the ‘Analyze with Davis’ action in a workflow automatically create a problem like the Anomaly Detection app, or do we need to use JavaScript to create the problem ?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 19:41:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281198#M2266</guid>
      <dc:creator>Akhil-Jayendran</dc:creator>
      <dc:date>2025-07-09T19:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Problem  with  workflow action "Analyze with Davis"</title>
      <link>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281213#M2267</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi Akhil,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Yes, you need to push the problem using a separate task. For instance, I have two executions—one without anomalies and another where the static threshold condition was exceeded.&lt;/P&gt;&lt;P&gt;Use values from the result JSON to define a condition in the next task. Based on that, I either send an alert to Slack or push a problem to the Problems API.&lt;/P&gt;&lt;P&gt;You’ll notice that the execution with an issue includes additional fields like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;raisedAlerts,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;numberOfViolations, etc., which help identify and handle the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 23:16:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281213#M2267</guid>
      <dc:creator>Emm4nuel</dc:creator>
      <dc:date>2025-07-09T23:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Problem  with  workflow action "Analyze with Davis"</title>
      <link>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281221#M2268</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/85008"&gt;@Emm4nuel&lt;/a&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;I’ve added a JavaScript action, but unfortunately it’s not working. My JavaScript knowledge is a bit limited. I’ve attached the workflow JSON ,any chance to have look?&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>Thu, 10 Jul 2025 04:26:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281221#M2268</guid>
      <dc:creator>Akhil-Jayendran</dc:creator>
      <dc:date>2025-07-10T04:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Problem  with  workflow action "Analyze with Davis"</title>
      <link>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281316#M2269</link>
      <description>&lt;P&gt;You have a structure mistake in your output variable, I fixed it: Try with this code:&lt;BR /&gt;&lt;BR /&gt;Please, let me know if it works for you.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { eventsClient, EventIngestEventType } from "@dynatrace-sdk/client-classic-environment-v2";
import { execution } from "@dynatrace-sdk/automation-utils";

export default async function ({ executionId }) {
  // Step 1: Get workflow execution result
  const exe = await execution(executionId);
  const checkResult = await exe.result("check_logs");

  // Step 2: Inspect output structure
  // I made the change here!
  const output = checkResult?.result?.output[0];
  const dimensions = output?.dimensions || [];

  console.log("Full dimensions:", JSON.stringify(dimensions, null, 2));

  // Step 3: Extract potentialAlerts from dimensions
  const potentialAlertDim = dimensions.find(dim =&amp;gt; dim.key === "potentialAlerts");
  console.log("Raw potentialAlertDim:", potentialAlertDim);

  const potentialAlerts = parseInt((potentialAlertDim?.value || "0").trim(), 10);
  console.log("Parsed potentialAlerts:", potentialAlerts);

  // Step 4: If alert count &amp;gt; 0, send a custom event
  if (potentialAlerts &amp;gt; 0) {
    const hostDimension = dimensions.find(dim =&amp;gt; dim.key === "dt.entity.host");
    const hostId = hostDimension?.value;

    if (hostId) {
      console.log(`Raising event on host: ${hostId}`);

      await eventsClient.createEvent({
        body: {
          eventType: EventIngestEventType.CustomAnnotation,
          title: "⚠️ Predicted Disk Capacity Alert",
          description: "Disk issue detected based on timeseries analysis",
          entitySelector: `type(HOST),entityId("${hostId}")`,
          properties: {
            "dt.entity.host": hostId,
            severity: "warning"
          },
          source: "workflow-automation"
        }
      });
    } else {
      console.log("Host ID not found in dimensions.");
    }
  } else {
    console.log("No potential alerts found.");
  }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 15:16:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281316#M2269</guid>
      <dc:creator>Emm4nuel</dc:creator>
      <dc:date>2025-07-10T15:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Problem  with  workflow action "Analyze with Davis"</title>
      <link>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281323#M2270</link>
      <description>&lt;P&gt;Thank you so much &amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/85008"&gt;@Emm4nuel&lt;/a&gt;&amp;nbsp; , it worked like a charm.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 18:18:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Generating-Problem-with-workflow-action-quot-Analyze-with-Davis/m-p/281323#M2270</guid>
      <dc:creator>Akhil-Jayendran</dc:creator>
      <dc:date>2025-07-10T18:18:55Z</dc:date>
    </item>
  </channel>
</rss>

