How to log an incident in ServiceNow from UiPath when specific error occurs?

Here is the workaround to integrate UiPath with ServiceNow.

  • Modify UiRobot NLog configuration file to include web service target for ServiceNow and pass required parameters.

You can find UiRobot NLog configuraion file @ %LocalAppData%/Uipath/version/

  • With the help of filters, unwanted logs can be ignored. In this example, incident will be logged to ServiceNow only if log message contains “Status:Failed”.

  • When UiRobot executes a process, an incident will be logged to ServiceNow with the details provided.

Note:

  • Above code is tested for stand alone UiRobot with execution license. Same code can be included in Orchestrator web.config to log incidents whenever error is logged from any Robot connected to the Orchestrator.

  • “all-event-properties” are not available in Nlog config for UiRobot. If certain fields from log message need to be extracted like RobotName, Machine Name, you can use regular expressions.
    e.g.

4 Likes

Hi @ronlobo

Cool tutorial! :slight_smile:

I moved it to the FAQ section.

2 Likes

Hello,
In this way you can create an incident in ServiceNow directly from Orchestrator WebHooks:

Thanks,
Cristian Negulescu