Create and Update Incident (ServiceNow) - Workflow
  • 18 Oct 2024
  • Dark
    Light
  • PDF

Create and Update Incident (ServiceNow) - Workflow

  • Dark
    Light
  • PDF

Article summary

Workflow TItle


Let’s move into the Incident Create and Update use case. We will begin by reviewing the Itential Pre-Builts that we are using for today’s Workshop.

Create a Workflow Video - Part 1

Step 1

Go to Automation Studio and expand the Workflows drop down.

Step 2

Expand the Workflow Group for Create and Update Incident - ServiceNow

Step 3

This use case will incorporate three Itential Pre-built workflows through the use of Childjob tasks. Click into the Create Incident - ServiceNow Workflow.

Step 4

The Create Incident - ServiceNow Pre-built workflow utilizes the Itential ServiceNow Adapter. There is one main task, Create Incident. This task reaches out to ServiceNow and creates a new Incident.

Step 5

Next, click into the Update Incident - ServiceNow Workflow.

Step 6

The Update Incident-ServiceNow Pre-built workflow also utilizes the Itential ServiceNow Adapter. There are two main tasks, Get Incident and Update Incident. The Get Incident task reaches out to ServiceNow to obtain the incident's specific information while the Update Incident provides an incident update back to ServiceNow .

Step 7

Finally, click into the Run Command and Jinja2 Template Itential Pre-built Workflow.

Step 8

The Run Command and Jinja2 Template Itential Pre-built Workflow has three primary tasks. The first creates a device array, the second executes a Command Template against the array, while the last takes the results from the command template and renders it in a Jinja2 template for incorporation into our ServiceNow incident.

Step 9

Now that we’ve gone over the Itential Pre-builts, we’ll continue with our workshop exercise building a workflow that uses the JSON Form and Transformation (JST) you built earlier.

Click the at the top of the left navigation panel. 

Step 10

The Create window opens. Click the drop down and select Workflow.

Step 11

Create a New Workflow Named Lab - Incident - ServiceNow - XX. (XX represents your initial)

Step 12

A fresh workflow canvas opens. For this workflow you will first add all of the tasks to the canvas, then connect them with transitions. Finally you will configure each task. 

A fresh workflow canvas opens. Add a Transformation task by entering Transformation into the Search box at the top right. The JSON Transformation task appears. Hover the mouse over the task. 

A + will appear to the left of the task. Click the + to add the task to the canvas.

Step 13

Click the JSON Transformation task and drag on the canvas just to the right of the Start task.

Step 14

Next, you will need to add four Childjob tasks by entering child job into the Search box at the top right. The Childjob task appears. Hover the mouse over the task. 

A + will appear to the left of the task. Click the + four times to add the tasks to the canvas.

Step 15

You will need to adjust the placement of the Childjob tasks on the canvas. Click on each Childjob task and drag it to the positions shown in the image below.

Step 16

Finally, you will need to add two Query tasks to the canvas. Enter query into the Search box at the top right. The Query task appears. Hover the mouse over the task. 

A + will appear to the left of the task. Click the + twice to add the tasks to the canvas.

Step 17

You will need to adjust the placement of the Query tasks on the canvas. Place the first Query task between the first and second Childjob tasks. Place the second Query task between the third and fourth Childjob tasks. When complete, your workflow should look like the image below.

Step 18

The next step is to add transitions which will connect the tasks together to form the workflow. This is done by clicking the crossed arrows button at the top of the canvas, then click and drag from the center of the START task to the center of the first JSON Transformation task.

Step 19

Add additional transitions between each task.


Create a Workflow Video - Part 2

Step 20

The next step is to begin configuring the workflow tasks. Double click the first JSON Transformation task to configure it.

Step 21

Configure the Transformation task by making the following changes:

  • Enter Lab - Incident - ServiceNow in the in the Transformation Name field and select the Lab - Incident - ServiceNow - JST - XX (XX represents your initials).

By changing the Location for formData under Incoming Schema from static to job, we are configuring the Transformation task to source the data from the form inputs submitted to the workflow, rather than static inputs.

  • Change location for formData under Incoming Schema from static to Job. Ensure formData is selected in the Value field. 
  • Change location for user under Incoming Schema from static to Job. Ensure initiator is selected in the Value field. 

Click Save.

Step 22

Next, double click the first Childjob task.

Step 23

Update the Summary to Create Incident. Update the Description to Create Incident using Itential Pre-built.

Enter Create Incident - ServiceNow in the Workflow search box, select the Create Incident - ServiceNow workflow. Note, this is the first Pre-built we looked at earlier.

Make the following changes to Job Variables:

NameLocationValue
summaryLab - Incident - ServiceNow JST - XXincidentSummary
commentsstatic
callerstaticWorkshop

Click Save.

Step 24

Double click the first Query Task.

Step 25  

Update Summary and Description to Query Incident Number.

Make the following changes to Incoming:

VariableReference taskReference variable
pass_on_nullstaticFalse
querystaticcreateIncident.response.number
objCreate Incidentjob_details

Click Save.

Step 26

Double click the second Childjob task.

Step 27

Update Summary to Set Incident in Progress. Update Description to Set Incident in Progress using Itential Pre-built. Enter Update Incident - ServiceNow" in the Workflow search box, select the Update Incident - ServiceNow workflow. This is the second Pre-built workflow we reviewed earlier.

Make the following changes to Job Variables:

NameLocationValue
incNumberQuery Incident Numberreturn_data
commentsstatic
statestaticin progress

Click Save.

Step 28 

Double click the third Childjob task.

Step 29

Update the Summary to Run Command and Jinja2 Template. Update the Description to Run Command and Jinja2 Template using Itential Pre-built.

Enter Run Command and Jinja2 Template in the Workflow search box, select the Run Command and Jinja2 Template workflow. This is the third Pre-built workflow we reviewed earlier. 

Make the following changes to Job  Variables:

NameLocationValue
deviceLab - Create and Update Incident - ServiceNow - XXdevice
commandLab - Create and Update Incident - ServiceNow - XXcommand
templateNamestaticFormat ServiceNow Comment

Click Save.

Step 30

Double click the second Query Task.

Step 31 

Update the Summary and Description to Query ServiceNow Comment. 

Make the following changes to Incoming:

VariableReference taskReference variable
pass_on_nullstaticfalse
querystaticrenderedTemplate
objRun Command and Jinja2 Templatejob_details

Click Save.

Step 32  

Double click the fourth Childjob task.

Step 33

Update the Summary to Update Incident. Update the Description to Update Incident using Itential Pre-built. Enter Update Incident in the Workflow search box and select Update Incident - ServiceNow. This is the original Pre-built workflow we reviewed early. 

Make the following changes to Job Variables:

NameLocationValue
incNumberQuery Incident Numberreturn_data
commentsQuery ServiceNow Commentreturn_data
statestatic

Click Save.

Step 34

Your workflow is now complete. Click the SAVE icon followed by the icon.  

Step 35

In the Job Description window, click START

Step 36

The Set Variables window opens, showing the variables the workflow requires to run. This workflow expects to receive one variable, formData, which will be passed in from Operations Manager, which will be covered in the next module.

The START button will run the workflow, but we are only testing it to confirm the inputs. Your view should match the image below.



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.