cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ServiceNow integration - REST API

Anonymous
Not applicable

Hello Community and a Happy New Year

 

Is there a way to configure a http request template to be able to close an existing servicenow incident on Health Rule Violation Ending by locating an existing record using the sys_id ?

 

Post /api/now/table/incident

Put /api/now/table/incident/{sys_id}

 

thanks

Steve

1 REPLY 1

Anonymous
Not applicable

Hello, Steven. Normally customers use an event management system, for this reason, otherwise, your ticket may get extremely cluttered or you will end up with a lot of duplicate tickets. We do not have an integration which does what you are asking, but if you look at how we integrate with ServiceNow Event Management you can likely derive a new HTTP Action template from the concept using the table API. 

 

#set($controllerName="demo1.appdynamics.com")
{
"records":[
#foreach(${event} in ${fullEventList})

#foreach(${entity} in ${event.affectedEntities})
#if($foreach.index > 0)
,
#end
{
"source": "AppDynamics"
,"event_class": "$controllerName"
,"x_apd_appdynamics_event_source_url": "$event.deepLink"
#if( $entity.entityTypeDisplayName == "Node" )
,"node": "$entity.name"
, "resource": "$entity.name"
, "ci_type": "x_apd_appdynamics_node"
,"ci_identifier" :{
"name":"$entity.name",
"tier_name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Tier" )
,"node": "$entity.name"
, "resource": "$entity.name"
, "ci_type": "x_apd_appdynamics_tier"
,"ci_identifier" :{
"name":"$entity.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Application" )
,"node": "$entity.name"
, "resource": "$entity.name"
, "ci_type": "x_apd_appdynamics_application"
,"ci_identifier" :{
"name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Business Transaction" )
, "ci_type": "x_apd_appdynamics_tier"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.tier.name"
,"ci_identifier" :{
"name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Service Endpoint" )
, "ci_type": "x_apd_appdynamics_tier"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.tier.name"
,"ci_identifier" :{
"name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif( $entity.entityTypeDisplayName == "Backend" )
, "ci_type": "x_apd_appdynamics_remote_service"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$entity.name"
,"ci_identifier" :{
"name":"$entity.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#else
#if($event.node)
, "ci_type": "x_apd_appdynamics_node"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.node.name"
,"ci_identifier" :{
"name":"$event.node.name",
"tier_name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif($event.tier)
, "ci_type": "x_apd_appdynamics_tier"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.tier.name"
,"ci_identifier" :{
"name":"$event.tier.name",
"application_name":"$event.application.name",
"controller_name": "$controllerName"
}
#elseif($event.application)
, "ci_type": "x_apd_appdynamics_application"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
,"node": "$event.application.name"
,"ci_identifier" :{
"name":"$event.application.name",
"controller_name": "$controllerName"
}
#else
, "node": "$entity.name"
, "resource": "$entity.entityTypeDisplayName - $entity.name"
#end

#end
#if($event.healthRule)
,"metric_name" : "$event.healthRule.name"
#set( $msg=$event.healthRule.name)
#else
#set( $msg="")
#end
#set( $msg=$msg + ". " + ${event.eventMessage})
#set( $msg = $msg.replace("<b>", "") )
#set( $msg = $msg.replace("</b>", "") )
#set( $msg = $msg.replace("<br>", "") )
,"description" : "$msg"
#if($event.eventType == "POLICY_OPEN_WARNING"
|| $event.eventType == "POLICY_CONTINUES_WARNING"
|| $event.eventType == "POLICY_DOWNGRADED")
,"severity": "2"
#elseif($event.eventType == "POLICY_OPEN_CRITICAL"
|| $event.eventType == "POLICY_CONTINUES_CRITICAL"
|| $event.eventType == "POLICY_UPGRADED")
,"severity": "1"
#elseif($event.eventType == "POLICY_CLOSE_WARNING"
|| $event.eventType == "POLICY_CLOSE_CRITICAL"
|| $event.eventType == "POLICY_CANCELED_WARNING"
|| $event.eventType == "POLICY_CANCELED_CRITICAL")
,"severity": "0"
#end
}
#end
#end
]
}

Ask the Experts Session: Hybrid Application Monitoring Deployment

Join us on Feb 26 to explore Splunk AppDynamics deployment strategies, SaaS models, agent rollout plans, and expert best practices.


Register Now

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here