cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I test in a workflow task how I am triggered?

henk_stobbe
DynaMight Leader
DynaMight Leader

Hello "workflow friends",

 

Can you select to run a task based on the trigger e.g. "Manual trigger or Event trigger".

Or can I select this within the js?

KR Henk

4 REPLIES 4

Cameron-Leong
Dynatrace Helper
Dynatrace Helper

Hello,

If you want to know what type of trigger the workflow is using, it is shown in the label on the first tile.

CameronLeong_0-1721257523060.pngCameronLeong_1-1721257525080.png

If you set an event trigger, you still have the option to manually trigger an execution by hitting "Run" at the top. 

CameronLeong_2-1721257631239.png

Thanks

Hello  Cameron-Leong,

Thanks for your reply!

But what I like to know if the same information is available from within the workflow e.g. 

If you have a manual trigger, can you skip a task based on this info,

 

Thanks Henk

 

The team provided a solution via a JS task that looks promising to me: 

 

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 }; }
 
The result would be a property named triggerType with a value like Manual .If you like to do it with the automation-utils, you could also write

import { execution } from '@dynatrace-sdk/automation-utils'; export default async function ({ execution_id }) { const ex = await execution(execution_id); return { triggerType: ex.triggerType }; }
 
In following actions you can add the conditions referencing to the result of this JS action.
 
Does that help?

Wolfgang.

Yes this will help (-; Thanks to you and the team,

KR Henk

Featured Posts