06 Jun 2024 05:28 PM - last edited on 07 Jun 2024 09:14 AM by MaciejNeumann
Hi All,
I have workflow having task of SRG validation and this task needs input as test timeframe to evaluate srg.
Howe we can call this workflow using dynatrace API and how we can pass SRG task input from API??
Regards,
Heramb Sawant
07 Jun 2024 06:17 AM
Please help me to on this issue.
07 Jun 2024 08:12 AM
Hello!
You can make use of the API call /workflows/{id}/run to trigger the execution of a particular workflow. And then in the request body you can send some information. For example:
{
"input": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"params": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"uniqueQualifier": "string"
}
This information is then available for ypu to use in the workflow execution time.
For executing this API call the Required scope: automation:workflows:run is needed for the token.
Best
05 Jul 2024 11:57 AM
Could you please tell me how to capture/receive these input parameters in workflow task.
Regards,
Heramb
05 Jul 2024 01:30 PM
Also If I add above given parameters in the api body as it is. in the response I get workflow status success but workflow do not triggered and If I just remove the above given input parameters , API works fine workflow status is Running.
What could be the reason here ??
Regards,
Heramb sawant
05 Jul 2024 06:38 PM
You might be able to get that information from the execution log with a js block:
https://developer.dynatrace.com/reference/sdks/client-automation/#getexecutionlog
import { executionsClient } from "@dynatrace-sdk/client-automation";
const data = await executionsClient.getExecutionLog({
id: "...",
});
An alternative to send the values you want is to change the trigger to a bizevent and send all the information you need in that bizevent:
https://docs.dynatrace.com/docs/shortlink/ba-api-ingest