<?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: How do I test in a workflow task how I am triggered? in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250980#M1706</link>
    <description>&lt;P&gt;The team provided a solution via a JS task that looks promising to me:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;import { executionsClient } from "@dynatrace-sdk/client-automation"; export default async function ({ execution_id }) { const executionInfo = await executionsClient.getExecution({ id: execution_id, }) return { triggerType: executionInfo.triggerType }; }&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;The result would be a property named&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;triggerType&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with a value like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;Manual&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;.If you like to do it with the automation-utils, you could also write&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;import { execution } from '@dynatrace-sdk/automation-utils'; export default async function ({ execution_id }) { const ex = await execution(execution_id); return { triggerType: ex.triggerType }; }&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;In following actions you can add the conditions referencing to the result of this JS action.&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;Does that help?&lt;/DIV&gt;</description>
    <pubDate>Thu, 18 Jul 2024 14:10:21 GMT</pubDate>
    <dc:creator>wolfgang_heider</dc:creator>
    <dc:date>2024-07-18T14:10:21Z</dc:date>
    <item>
      <title>How do I test in a workflow task how I am triggered?</title>
      <link>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250882#M1701</link>
      <description>&lt;P&gt;Hello "workflow friends",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you select to run a task based on the trigger e.g. "Manual trigger or Event trigger".&lt;/P&gt;&lt;P&gt;Or can I select this within the js?&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 14:58:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250882#M1701</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2024-07-17T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test in a workflow task how I am triggered?</title>
      <link>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250921#M1703</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;If you want to know what type of trigger the workflow is using, it is shown in the label on the first tile.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CameronLeong_0-1721257523060.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21211iD52013B5DD4F8D3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CameronLeong_0-1721257523060.png" alt="CameronLeong_0-1721257523060.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CameronLeong_1-1721257525080.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21212iE62925E3AB0DE33F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CameronLeong_1-1721257525080.png" alt="CameronLeong_1-1721257525080.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you set an event trigger, you still have the option to manually trigger an execution by hitting "Run" at the top.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CameronLeong_2-1721257631239.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21214i8C6B6BADC3D51301/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CameronLeong_2-1721257631239.png" alt="CameronLeong_2-1721257631239.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 23:07:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250921#M1703</guid>
      <dc:creator>Cameron-Leong</dc:creator>
      <dc:date>2024-07-17T23:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test in a workflow task how I am triggered?</title>
      <link>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250936#M1705</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/54146" target="_self"&gt;&lt;SPAN class=""&gt;Cameron-Leong,&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;But what I like to know if the same information is available from within the workflow e.g.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have a manual trigger, can you skip a task based on this info,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Henk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:06:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250936#M1705</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2024-07-18T07:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test in a workflow task how I am triggered?</title>
      <link>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250980#M1706</link>
      <description>&lt;P&gt;The team provided a solution via a JS task that looks promising to me:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;import { executionsClient } from "@dynatrace-sdk/client-automation"; export default async function ({ execution_id }) { const executionInfo = await executionsClient.getExecution({ id: execution_id, }) return { triggerType: executionInfo.triggerType }; }&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;The result would be a property named&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;triggerType&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with a value like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;Manual&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;.If you like to do it with the automation-utils, you could also write&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;import { execution } from '@dynatrace-sdk/automation-utils'; export default async function ({ execution_id }) { const ex = await execution(execution_id); return { triggerType: ex.triggerType }; }&lt;/PRE&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;In following actions you can add the conditions referencing to the result of this JS action.&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="p-rich_text_section"&gt;Does that help?&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Jul 2024 14:10:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250980#M1706</guid>
      <dc:creator>wolfgang_heider</dc:creator>
      <dc:date>2024-07-18T14:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test in a workflow task how I am triggered?</title>
      <link>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250982#M1707</link>
      <description>&lt;P&gt;Wolfgang.&lt;/P&gt;&lt;P&gt;Yes this will help (-; Thanks to you and the team,&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 14:15:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/How-do-I-test-in-a-workflow-task-how-I-am-triggered/m-p/250982#M1707</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2024-07-18T14:15:27Z</dc:date>
    </item>
  </channel>
</rss>

