Automation Utils
Automation utilities.
npm install @dynatrace-sdk/automation-utils
Functions
actionExecution
actionExecution(id?): Promise<ActionExecution>
Retrieves the action execution details for the current workflow.
Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the action execution to retrieve. If not provided, the ID from the caller service metadata is used. |
Returns
Description |
---|
The action execution details. |
Code example
//To get current action execution detail
import { actionExecution } from '@dynatrace-sdk/automation-utils';
const actionExe = await actionExecution();
Code example
//To get loopItem from current action execution
import { actionExecution } from '@dynatrace-sdk/automation-utils';
const actionExe = await actionExecution();
const loopItem = actionExe.loopItem;
// or
const { loopItem } = actionExe;
execution
execution(id?): Promise<IExecution>
Retrieves the execution details for the current workflow.
Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the execution to retrieve. If not provided, the ID from the caller service metadata is used. |
Returns
Description |
---|
The execution details. |
Code example
//To get current execution detail
import { execution } from '@dynatrace-sdk/automation-utils';
const exe = await execution();
Code example
//To get event context from current execution
import { execution } from '@dynatrace-sdk/automation-utils';
const exe = await execution();
const eventContext = exe.event();
Code example
//To get current task execution result
import { execution } from '@dynatrace-sdk/automation-utils';
const exe = await execution();
const result = await exe.result();
result
result(predecessorTaskName): Promise<any>
Retrieves the result of a task execution in the current workflow.
Parameters
Name | Type | Description |
---|---|---|
predecessorTaskName*required | string | The name of the predecessor task. |
Returns
Description |
---|
The result of the predecessor task execution. |
Code example
//To get a predecessor task execution's result
import { result } from '@dynatrace-sdk/automation-utils';
const taskExecutionResult = await result('predecessor_task_1');
Still have questions?
Find answers in the Dynatrace Community