Hello Team,
Can someone help me to build workflow for below use case :
We want Dynatrace to send SMS notification for problems generated between 18:00 To 06:00(nextDay) monday to friday if the impacted entity falls under sev1 or sev2 category.
I am using Problem based trigger and need help to build query to filter problem where time stamp is after 18:00 or before 06:00 and day is between Monday to Friday.
I have DQL query to fetch events with this filter but can I trigger workflow using this ? if yes, How ?
Do you know how can we use match phrase function in workflow ?
Set the trigger to every morning at 9 AM (for example)
In 2nd step add Task to execute JavaScript code. In the code you have to call APIs to fetch the problems that has come after 18:00 and within 06:00 and from their you can get the problems that has higher severity. You get the JSON as an output and that can be fed to the next step.
In the 3rd step you can use HTTP request and configure your result in such a way that in will be sent to the person based on the web hook you get from the customer and respective headers for it.
Note: You have to reconfigure your JSON output in 2nd step itself so that SMS messages will not be split in the 3rd step.
You can use both, but you can’t use Davis problem trigger as a task. For that, you’ll need to run some JavaScript. There’s a library that can fetch problems in the same tenant.
Just wanted to share approach I used to achieve this -
1. Used Davis Problem Trigger for problems in Open or Closed state and having certain conditions like tag=“abc”.
2. Task (JavaScript) to get output of trigger check conditions for time like hour after 6 PM and weekday or weekend and call SMS API if conditions are matching.
There are some SDKs available to get data of trigger or previous which we can use during workflow creation, but tedious task is to understand the syntax of JavaScript.
Hi Omkar, I’m having a hard time understanding how to use JavaScript to get the information, could you help me by indicating which SDK you used since I’m looking to make a similar workflow and with the trigger data it would help me define my flow
Hello @JhonU,
If you’re still looking for it, here are the SDKs you can use. @dynatrace-sdk/automation-utils :- to get details from previous tasks or trigger within execution.