Hello,
I want to bring the below data into an email via workflow.
fetch events, from: now()-5m, to: now()
| filter event.kind == “DAVIS_PROBLEM”
| filter event.status_transition == “CREATED”
| fields timestamp, display_id, event.category, event.start, event.end, event.name, event.status, event.status_transition, root_cause_entity_id, root_cause_entity_name
| sort event.start desc
Could you please help, how?
Currently, I’m just getting an email with a link to workflow.
Thanks,
MH
Assuming you have at least 3 tasks, the trigger, the DQL, named as “execute_dql_query_1” and the email.
In the email task you should include the previous (DQL) task result in the email Message field, like this:
{{ result("execute_dql_query_1")["records"] | to_json}}
This way, you will get the DQL query result as json format in your email.
Try and let us know.
Worked :). But throttled with limit so I’ve reduced the time frame.
Also how can I propagate Dynatrace problem link to each problems?
Using the concat function:
fetch events, from: now()-5m, to: now()
| filter event.kind == "DAVIS_PROBLEM"
| filter event.status_transition == "CREATED"
| fieldsAdd tenant.url = "https://<YOURTENANTIDHERE>.apps.dynatrace.com/ui/apps/dynatrace.davis.problems/problem/"
| fieldsAdd problem.url = concat(tenant.url, event.id)
| fields timestamp, display_id, event.category, event.start, event.end, event.name, event.status, event.status_transition, root_cause_entity_id, root_cause_entity_name, problem.url
| sort event.start desc
Try and let us know.
Thank you 
I used this -
fetch events,from:-1m, to: now()
| filter event.kind == “DAVIS_PROBLEM”
| sort timestamp desc
| filter event.status != “CLOSED”
| fieldsAdd problem_url=concat(“https://{environmentid}.apps.dynatrace.com/ui/apps/dynatrace.davis.problems/problem/”, event.id) and getting the expected JSON. Now I need to convert the JSON to text. Could you please help how?
Thanks 