Dynatrace & ServiceNow integration through Flow Desingner

devendar koduri
Tera Contributor

Create logic to provide the SNOW incident number back into the Dynatrace problem record as a comment for each ServiceNow incident created for Dynatrace.

Not all Dynatrace problems make ServiceNow incidents, but all of them that do make an incident we want the associated incident wrote back from ServiceNow into the associated Dynatrace problem.

The ServiceNow incidents for Dynatrace can be found looking for the monitoring tool = Dynatrace.

Every ServiceNow incident created from Dynatrace is automatically populated in the ServiceNow incident description field. The problem ID, formatted as pid:=7493974611236383952_1739787480000V2. The incident description field tie back into Dynatrace.

So i need to use the pid to populate the incident number as a comment in the Dynatrace problem record. So kindly help us on this story.


Is it possible through Flow Designer ?

 

1 REPLY 1

Viraj Hudlikar
Giga Sage

Hello @devendar koduri 

 

Yes, did you give a try? Any challenge?

If we have start with Flow Designer then 

Trigger will be "When an Incident is Created" with condition as monitoring_tool field is set to "Dynatrace

Add a "Script" action to extract the problem ID from the incident description. Here is an example script

var description = current.description;
var problemIdMatch = description.match(/pid:=(\d+_\d+V\d+)/);
if (problemIdMatch) {
    var problemId = problemIdMatch[1];
    return problemId;
}
return null;

 

Last it will be add a "REST API" action to call the Dynatrace Problems API and in body you can pass inc number and in your endpoint you will use pid number return from previous action step.

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.