Creating a service that requires an approval using the Dynamic Workload Console
You can create a service that must go through an approval process from the Dynamic Workload Console.
The scope of the scenario is to create a service that generates a GitHub license request.
John is a HCL Workload Automation 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 job stream that contains a ServiceNow job. 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 job stream
named GitHub_workflow.
- From the Design menu, click Graphical Designer page.
- From the Blocks tab, drag a job stream and drop it into the workspace.
- In General info, in Workstation, select a workstation.
- In General info, in Name, type GitHub_workflow.
- Create and publish the service.
- In GitHub_workflow, click the Add triggers icon.
- On the right-side panel, click Add new and select Service.
- In the properties panel, 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.
- Add variables to the service.
- Select Add variable.
- In Variable, in Name, type description.
- In Display name, type Business justification.
- In Type, select String from the drop-down menu.
- Click on the Required toggle button.
- In Placeholder, type Motivate your GitHub license request.
- Add a ServiceNow job 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 info, in Workstation, select a workstation.
- In General info, in Name, type GitHub_task.
- In Connection, in Host, type your ServiceNow instance name.
- In Credentials, select Basic Authentication, enter your credentials and perform the Test connection.
- Provide the details for GitHub_task.
- In Action, select Create.
- In Table name, click Search and then select Ticket.
- 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.
- Check the Create and monitor box.
- 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 job.
- 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.