- 18 Oct 2024
-
DarkLight
-
PDF
Create and Update Change Request (ServiceNow) - Workflow
- Updated on 18 Oct 2024
-
DarkLight
-
PDF
Let’s move into the Change Request Create and Update use case. We will begin by reviewing the Itential Pre-Builts that we are using for today’s Workshop.
- Create Change Request - ServiceNow
- Update Change Request - ServiceNow
These Itential Pre-Builts are an excellent example of modular automations. They can be incorporated as steps in a larger automation very easily. We will incorporate these modular automations through the use of child jobs. A child job is a workflow nested within another workflow, allowing for the same workflows to be referenced in multiple automations. Rather than recreating the same workflow multiple times, we are reusing the same asset so that only one workflow needs to be maintained going forward.
Workflow Video (Part 1)
Step 1
From the Itential Automation Platform dashboard, click Automation Studio in the left navigation panel.
Step 2
From the Automation Studio dashboard, expand the workflow grouping.
Step 3
Locate the Workflow Group Create and Update Change Request – ServiceNow and click to expand it.
Step 4
Click on the Create Change Request – ServiceNow workflow. This is the first Pre-Built workflow we will look at.
Step 5
In this workflow, you can see various task types. IAP has four task types: Termination, Automatic, Operational, and Manual. Let’s define these individually.
- Every workflow has Termination tasks to start and end the workflow. All other tasks are placed between the Start and End Termination tasks.
- The green tasks represent Automatic tasks. These tasks will execute without intervention.
- Next are Operational tasks, which are purple. Operational tasks are used to control workflows with conditional branches and loops, and to manipulate run time data.
- The fourth task type is Manual tasks. Manual tasks are grey and represent tasks that require human interaction.
Step 6
The Create Change Request - ServiceNow Pre-Built workflow utilizes the Itential ServiceNow Adapter. There is one main task, Create Change Request. This task reaches out to ServiceNow and creates a new Change Request.
Step 7
The next Pre-Built workflow we will review is the Update Change Request - ServiceNow Pre-Built workflow which looks very similar to the previous Pre-Built. It is comprised of two primary tasks: Get Change Request and Update Change Request. In our exercise today, we will retrieve the Change Request that was created in the first Pre-Built and then update it.
Step 8
Now that we’ve gone over the Itential Pre-Built, we’ll continue with our workshop exercise building a workflow that uses the JSON Form and Transformation (JST) you built earlier.
Workflow Video (Part 2)
Step 9
From the Automation Studio dashboard, click the + at the top of the left navigation panel.
Step 10
We want to create a new workflow. We name it Lab - Create and Update Change Request - ServiceNow - XX and click CREATE.
Step 11
A fresh workflow canvas opens. In this use case, we would like to build our workflow horizontally, so we will click and drag our Terminator tasks so they are aligned horizontally.
Now that we are aligned horizontally, we are ready to start adding tasks to the workflow.
Step 12
The first task we need is a Transformation task. We enter transformation into the filter box and the palette will automatically filter as you type.
Step 13
We will need two Transformation tasks and add them to the canvas. We reopen the task palette, and search for our next task.
Step 14
Next, we need two Child Jobs.
Step 15
Enter Child in the Task Palette search box to filter the task list for the Child Job task.
Step 16
And add two Child Job tasks to the canvas. We need one more task.
Step 17
We filter the task list for the View Data task.
Step 18
And drag it to the workflow between the last Transformation and Child Job tasks. Close the task list,
Step 19
Next, we need to add transitions between each task to bring them together. To add a success transition, click the first task, in this example the Start task.
Step 20
And you will see a shaded dotted border appear around the task. Click in the shaded area and drag to the next task in the workflow.
Note: The default transition is a Success transition. If you would like to add an Error or Failure transition, press and hold the E or F key on your keyboard as you are adding the transition. If you would like to change an existing transition, right click on the transition and a popup will open. From the popup, you can choose to change the transition type or to delete the transition.
Step 21
Repeat this process to add a transition between the first Transformation task and the first Child Job task. Select the Transformation task and click the shaded area.
The transition is drawn.
Step 22
We repeat process for the remaining tasks.
Step 23
Next, we need to configure each of the tasks. We start with the Transformation task.
Step 24
For the Summary, enter Lab – Create and Update Change Request – ServiceNow - XX. To add a description, click the Details tab.
Step 25
We will keep the default description for this task. Click the Data tab.
Step 26
For the Transformation, click the dropdown list and select Lab – Create and Update Incident – ServiceNow - JST.
Click Save.
Step 27
Next, we need to configure the Input. For Variable Source, select Job, and for Value, enter formData. The purpose of the Transformation is to extract the individual values submitted in the form. 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.
Click Save.
Workflow Video (Part 3)
Step 28
Next, let’s configure the first Child Job task. We double-click the task to open the Configuration window.
Step 29
We update the Summary to Create Change Request and go to the Details tab to add a description.
Step 30
We update the Description to Create Change Request using Itential Pre-built and return to the Data tab to continue the configuration.
Step 31
Click the dropdown below Workflow and select the Create Change Request – Service Now workflow. This is the first Pre-Built workflow we reviewed earlier.
Step 32
We are ready to configure the task variables. For configurationItem, set Variable Source to Task and set Previous Task to Lab – Create and Update Change Request – ServiceNow JST. Set the Task Variable to configurationItem.
Step 33
Set the title variable, Variable Source to Task, and the Previous Task to Lab – Create and Update Change Request – ServiceNow JST. Select title for the Task Variable.
Step 34
For the summary variable, set the Variable Source to Task, and the Previous Task to Lab – Create and Update Change Request – ServiceNow JST. Select Summary for the Task Variable.
Step 35
The last two variables for the first Child Task are description and comments. For the description, the Variable Source should be set to Task, with the Previous Task set to Lab – Create and Update Change Request – ServiceNow JST. Set the Task Variable to description.
For the comments, the Variable Source should be set to Static, the Variable Type should be String, and enter Change Request Created by Itential Automation Platform for the Value.
Close the Configuration window.
Step 36
Next, we need to configure the second Transformation task. We change the Summary to Process CR Create Process. Then on the Details tab, add the description Perform a Transformation using the JST library.
Step 37
Returning to the Data tab, we click the Transformation drop down and select Process CR Create Response. Close the Configuration window.
Step 38
Next is the View Data task. Double click to configure it.
Step 39
We change the Summary to Pause for Change Completion and click the Details tab. For Description, we also add Pause for Change Completion.
Step 40
Returning to the Data Tab, for the header string, the Variable Source remains Static and we add Pause for Change Completion for the Header. For the message string, the Value is message.
Step 41
For body, we change the Value Source to Task, Previous Task is set to Process CR Create Response, and Task Variable is set to message. The variables object remains the same.
Step 42
Scrolling to the bottom of the list of variables, we add Continue for the value of button_success and leave btn_failure as is.
Step 43
The last task in the workflow is the second Child Job.
Step 44
We change the Summary to Update Change Request with a Description of Update Change Request using Itential Pre-Built.
Step 45
Returning to the Data tab, we click the Workflow dropdown and select Update Change Request - ServiceNow.
Step 46
For the crNumber variable, click the dropdown for Previous Task and select Process CR Create Response and change Task Variable to crNumber
Step 47
Scrolling to the bottom, we add the value Change Completed to the Comments string. Close the Configuration window.
Step 48
The Child Job has been configured and the workflow is complete. Click Save.
Itential’s Workflow canvas allows users to define the logic that matches their business process. In this use case example, we’ve used a few of Itential’s Pre-Built Automations to create a change request in ServiceNow; extract the status of the child job that created the change request; demonstrate it to the user in a manual step in the automation with a button that allows them to confirm that the automation should proceed; and update the change request with a comment. This is just an example workflow designed to show the flexibility of the Platform.