<?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: Trying to access previous tasks output for javascript task in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Trying-to-access-previous-tasks-output-for-javascript-task/m-p/260962#M1850</link>
    <description>&lt;P&gt;The code looks ok, could you verify the task get_unhealthy_workers actually has a result?&lt;BR /&gt;You can check that in an execution by looking at the result tab of the task details, example:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChristopherHejl_0-1730210081339.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/24253iFA6DF35314F25B49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChristopherHejl_0-1730210081339.png" alt="ChristopherHejl_0-1730210081339.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2024 13:54:46 GMT</pubDate>
    <dc:creator>ChristopherHejl</dc:creator>
    <dc:date>2024-10-29T13:54:46Z</dc:date>
    <item>
      <title>Trying to access previous tasks output for javascript task</title>
      <link>https://community.dynatrace.com/t5/Automations/Trying-to-access-previous-tasks-output-for-javascript-task/m-p/260865#M1847</link>
      <description>&lt;P&gt;My code is not returning anything to the log, I think I am following the proper format, must be something I am missing?&lt;/P&gt;
&lt;P&gt;Note: Format taken from -&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/platform-modules/automations/workflows/default-workflow-actions/run-javascript-workflow-action" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/platform-modules/automations/workflows/default-workflow-actions/run-javascript-workflow-action&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note: The previous task which completes successfully is - "get_unhealthy_workers"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import { execution } from '@dynatrace-sdk/automation-utils';&lt;BR /&gt;import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";&lt;/P&gt;
&lt;P&gt;export default async function ({ execution_id }) {&lt;BR /&gt;var ex = await execution(execution_id);&lt;BR /&gt;var getunhealthyworkers = await ex.result('get_unhealthy_workers');&lt;BR /&gt;console.log('The whole result object: ', getunhealthyworkers.alertText);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log from the execution:&lt;/P&gt;
&lt;P&gt;The whole result object: undefined&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 07:17:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Trying-to-access-previous-tasks-output-for-javascript-task/m-p/260865#M1847</guid>
      <dc:creator>rseibert1</dc:creator>
      <dc:date>2024-10-29T07:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to access previous tasks output for javascript task</title>
      <link>https://community.dynatrace.com/t5/Automations/Trying-to-access-previous-tasks-output-for-javascript-task/m-p/260962#M1850</link>
      <description>&lt;P&gt;The code looks ok, could you verify the task get_unhealthy_workers actually has a result?&lt;BR /&gt;You can check that in an execution by looking at the result tab of the task details, example:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChristopherHejl_0-1730210081339.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/24253iFA6DF35314F25B49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChristopherHejl_0-1730210081339.png" alt="ChristopherHejl_0-1730210081339.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 13:54:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Trying-to-access-previous-tasks-output-for-javascript-task/m-p/260962#M1850</guid>
      <dc:creator>ChristopherHejl</dc:creator>
      <dc:date>2024-10-29T13:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to access previous tasks output for javascript task</title>
      <link>https://community.dynatrace.com/t5/Automations/Trying-to-access-previous-tasks-output-for-javascript-task/m-p/261355#M1856</link>
      <description>&lt;P&gt;Thanks, I had forgotten to make sure return worked, simple fix.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 10:38:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Trying-to-access-previous-tasks-output-for-javascript-task/m-p/261355#M1856</guid>
      <dc:creator>rseibert1</dc:creator>
      <dc:date>2024-11-04T10:38:28Z</dc:date>
    </item>
  </channel>
</rss>

