HPE Developer Community Portal

HPE OneSphere and ServiceNow integration

sahana@hpe.com, gandharvas@hpe.com, krishna.kanth-mallela@hpe.com, mpatil@hpe.com, shiva.kum.m@hpe.com

HPE OneSphere ServiceNow Integration


HPE OneSphere is a multi-cloud management platform, essentially allowing end users to create an instance for their workload on-demand with a cloud vendor, in a vendor agnostic manner. To use HPE OneSphere, a user will need to create a project in OneSphere. The project should have specific attributes set via tags and also the project members and owners need to be set to ensure only approved members have project access. Once set, the user can login and create instances in any cloud attached to OneSphere. In this blog I will explain how a self service ticketing tool like ServiceNow can be integrated with OneSphere. The use case involves a user requesting a project in OneSphere and, once approved by his manager, the project is created in OneSphere. I have leveraged ServiceNow application integration interfaces and OneSphere REST APIs to build this integration. This blog walks you through the various steps to build an integration and you can reuse the same steps to build other integrations or extend this one in future.

onesphere app view

Sample application in ServiceNow

Import sample OneSphere-ServiceNow application

ServiceNow Studio is an IDE for ServiceNow and it is integrated with Git. To get started, open ServiceNow Studio and import from source control. Use the following Git location to import the sample integration https://github.com/HewlettPackard/hpe-onesphere-servicenow

import project

Import application to ServiceNow Studio

Browse through the sample integration

On the left panel you can see Tables, Forms, Business Rules and workflows.

studio form view

ServiceNow Studio view

Edit application to provide the HPE OneSphere details

Open the "Business Rule" (Script Action View) and provide values for these three attribtes

  1. oneSphereUri

  2. oneSphereUser

  3. oneSpherePassword


Edit application configuration

Create a new request

Now that you are all setup, launch your first request to OneSphere. In the search menu, search for "OneSphere". You will see a new form by the name "Create project". Select it to view the new form request. Submit your request with the project name, owner, member, tags etc.

submit project

Submit new project request

ServiceNow workflow to approve project request

Once the user has submitted a request, this will have to be approved by the project manager before the request is sent to OneSphere. Fred Luddy (in this example) is the manager, will approve the project.

Trivia : "Fred Luddy" is the founder of ServiceNow !!

approve project

Approve project request


Request workflow

What happens after approval ?

The business rule "Create project in OneSphere" kicks in. This JavaScript makes multiple REST API calls to OneSphere as below

  1. /rest/session to get session token
  2. /rest/projects to create a project
  3. /rest/users to get user URI and to add users if non-existent
  4. /rest/membership-roles to get project-owner and project-member role URIs
  5. /rest/memberships to add users as project owner or member of a project
  6. /rest/password-reset to reset user password if the user does not exist and this application created her/him.
servicenow javascript

Business rule in ServiceNow

Project created in OneSphere

Post approval the project is then created in OneSphere. If any of the project members or owners do not exist, they are created in OneSphere and a password reset is initiated. The user will be notified via email to change the password.

project in onesphere

"DemoServicenow" Project created in OneSphere

project settings

"DemoServicenow" Project settings

Next Steps

This completes the sample integration for ServiceNow with OneSphere. This can be further extended to change the AWS configuration for the user or add more members, etc. Also, this can be further extended to build a Service Catalog in ServiceNow.