Creating a service that requires an approval using the UI
You can create a service that must go through an approval process from the UI.
The scope of the scenario is to create a service that generates a GitHub license request.
John is an HCL Universal Orchestrator Administrator. John's manager has asked him to find a way to automate the request process of GitHub licenses. When submitting the service, the user must provide a justification for requesting the license, and the request must be approved by the Director of the business unit before the GitHub license can be assigned. The manager has also asked John to assign a high priority to the GitHub license request, so that the ticket can be handled quickly.
To automate the license issuance process, John decides to create a workflow that contains a ServiceNow task. To integrate with the ServiceNow application, John needs a ServiceNow instance name and credentials. After John has obtained the required information, he can start creating the service.
- Create a workflow named
GitHub_workflow.
- Open the Graphical Designer.
- From the Blocks tab, drag a workflow and drop it into the workspace.
- In General information, in Name, type GitHub_workflow.
- In Workstation, select a workstation.
- Create and publish the service.
- In GitHub_workflow, click the Add triggers
icon. - In the properties panel, click Add new and select Service.
- In Name, type GitHub_request.
- Click on the Published toggle button.
- In Tags, enter license, so that users can filter through services related to licenses.
- In GitHub_workflow, click the Add triggers
- Add variables to the service.
- Select Add variable.
- In Type, select String from the drop-down menu.
- In Name, type description.
- In Display name, type Business justification.
- In Placeholder, type Motivate your GitHub license request.
- Toggle the Required button.
- Add a ServiceNow task to
GitHub_workflow and define general information.
- In the Blocks tab, from the Human Tasks category, drag the ServiceNow task into GitHub_workflow.
- In General information, in Name, type GitHub_task.
- In Workstation, select a workstation.
- In Connection, in Host, type your ServiceNow instance name.
- Select Basic Authentication from the drop-down menu, then enter your credentials and perform the Test connection.
- Provide the details for GitHub_task.
- In Action, in Table name, click Search and then select Ticket.
- From the drop-down menu, select Create.
- In Task details, click Get fields and then select Description, Priority, and Short description.
- As Description value, type ${var.<description>}, so that the task can retrieve the variable value defined for the GitHub_request service.
- As Priority value, enter 2, to assign a high priority to the ticket when the service is submitted.
- As Short_description value, enter GitHub license request.
- Toggle the Create and monitor button.
- Define approval and rejection states of GitHub_task.
- In Approval State, click Get state and then select Closed Complete.
- In Rejection State, click Get state and then select Closed Incomplete.
- Define how often GitHub_task must check the state of the ticket on
ServiceNow and specify a timeout for the task.
- In Polling Interval, enter PT30M to check the state of the ticket every 30 minutes.
- In Polling Timeout, enter PT3D to set a 3 days timeout.
- Click Validate input if you want to verify the correctness of the provided inputs.
- Deploy the workspace.
The service is now ready and can be launched from the Self-Service Catalog. When someone submits the GitHub_request service, the status of the service can be monitored in My requests tab. The creation of the GitHub license needs to be approved, so the status of the service is Waiting for approval until the Director of the business unit approves the request on ServiceNow.
When the Director of the business unit approves the request by putting the ticket in Closed Complete status, the GitHub license is issued. The service then results Successful in My requests tab.