Request A Demo
Back to All Blog Articles

FlexDeploy Service Management: Create Incident on Workflow Failure

Service Management plays an integral role in managing, delivering, and auditing changes across the pipeline, as well as tracking incidents that occur as part of the software delivery lifecycle. In this blog series I will showcase four use cases for integrating a FlexDeploy pipeline with ServiceNow.

The first three use cases focused on Change Management. Let’s shift gears and talk about another use case for Incident Management.

When a deployment fails someone will need to take action to resolve the issue. Often times organizations look to record these events by creating an incident in their Service Management system. This is quite simple to implement using FlexDeploy’s Outgoing Webhooks. An outgoing webhook offers functionality to subscribe to FlexDeploy events and take some action. Most often, but not always, this is used to integrate outbound to external tools.

For this use case I created an outbound webhook to subscribe to the Workflow Completed event. The webhook function is implemented in Groovy, and makes use of a rich library of functions that are available out of the box. This function extracts information from the event payload (project name, environment name, and workflow execution id), and formulates a map setting the values for an incident.

Line 16 uses the createIncident function to create the ServiceNow incident.


Notice that the event is for “Workflow Completed”, which means that it applies whether it was successful or failed. In this case we only want to create an incident if the status is failed. Here we can make use of a Filter and conditionally return whether the function should be called. If the event is due to a failed workflow request the function will be executed, otherwise it will not.

Use a Filter in FlexDeploy to see if workflows failed.

We did not implement it here, but we could also filter to exclude build workflow failures. As implemented above the function applies to workflows of all types.

To test this use case I intentionally introduced a deployment failure for one of the packages in my snapshot.

Deployment failure in a package in FlexDeploy.

Reviewing the messages and logs for the webhook we can see that the event was fired and that it created an incident in ServiceNow.

Incident in ServiceNow

Incident log in ServiceNow

In ServiceNow we can see the short description and description that we set in the Groovy function.

Incident description in ServiceNow

Outbound Webhooks enable endless integration scenarios, and this example shows just how easy it is to incorporate Incident Management into your DevOps pipelines.

Related Resources

Integrating ACCELQ with FlexDeploy for Seamless Test Automation

ACCELQ is a cloud-based, continuous testing platform that offers codeless test automation for web, mobile, API, desktop, and packaged applications. ...

Mastering Source Control: Streamlining Functional Setup Data Sync with FlexDeploy and Git Integration in Oracle FSM

Effective source control management (SCM) is pivotal in ensuring the seamless tracking and management of functional setup data. In this ...

New in 7.0: Release Work Items

Work item tracking tools play a crucial role in the DevOps process, helping teams plan new features, resolve bugs efficiently, ...

Join DevOps leaders across the globe who receive analysis, tips, and trends in their inbox