HPE Developer Community Portal

HPE OneSphere and ServiceNow integration


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.

create project

New 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.

onesphere servicenow project view

ServiceNow Studio

Modify the application setup

Edit the following settings to match you setup

  1. Select Outbound-Rest and edit each of the OneSphere API's to point to your OneSphere instance, username and password
  2. Edit the application "OneSphere integration" to provide a specific role access to use the application. I have chosen the admin role. All users with this role can now use the application.
edit settings

Edit settings in Outbound REST

provide user access to application

Application user setting

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

Create a 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

workflow for project approval

ServiceNow workflow for new project approval by manager

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.
create project business rule

ServiceNow business rule as implemented in sample integration with OneSphere

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.

Slack Logo

Continue the conversation in the HPE Developer Slack community

Join the Community
Github Logo

Visit HPE github Organization and be part of the community

Develop Together

Stay in the loop

Sign up and be the first to know about our development platforms, news and project information as it becomes available.

By signing up for the HPE Developer Community Portal mailing list you agree to receive periodic email communications from our team.