deepakverma12
ServiceNow Employee
ServiceNow Employee
Hi Everyone,

 

This document provides instructions for setting up DocuSign and enabling external signing through document templates in the HRSD module.

 

Required Plugins:

  • Document Template Integration with DocuSign

  • Document Template

  • Human Resources Scoped App: Core

 

Configuration Steps for DocuSign Spoke

  1. Create a DocuSign Developer Account

  2. In the Admin tab, navigate to ‘Connect’.

  3. Create a new ‘Custom’ configuration.

  4. Fill in the following details:
    a. Name: Enter your instance name or any preferred identifier.
    b. URL to Publish: https://{instance_name}.service-now.com/api/sn_docusign_spoke/docusign_webhook
    c. Event Settings:
    - Data Format: Legacy
    - Event Message Delivery Mode: Aggregate
    - Trigger Events: Envelope Sent, Envelope Delivered, Envelope Signed/Completed, Envelope Declined, Envelope Voided
    d. Integration and Security Settings:
    - Select Include Basic Authentication Header and provide the ‘admin’ username and password.

  5. Click on Apps and Keys:
    a. Under Authentication, add the Secret Key and save it for later use.
    b. Additional Settings:
    - Redirect URIs: https://{instance_name}.service-now.com/oauth_redirect.do
    c. Save the configuration.

Configuration Steps in the ServiceNow Instance

  1. Download the setup folder.

  2. Import all XML files provided in the setup.

  3. Open the script in the Background Scripts module.

  4. Update the specified values in the script, then run it.

  5. Assign the ‘sn_docusign_spoke.docusign_admin’ role to the ‘admin’ user.

  6. Navigate to /oauth_2_0_credentials_list, open the DocuSignCreds entry, and click Get OAuth Token.

  7. Go to /sn_docusign_spoke_accounts_list and click Get Accounts(Refresh the page you should be able to see a record).



Testing the Flow

  1. Create an HR case with the HR Service ‘Verification of Employment’.

  2. Remove the Document Template category and select the DocuSignHTML template that was imported.

  3. Ensure that the ‘Opened For’ user has a valid email address linked to the HR case.

  4. Change the case state to Work in Progress.

  5. Preview the document and initiate the Document Task.

  6. You should see a Document Task created.

  7. Open the document, sign it, and after a few seconds, the Document Task should automatically close

    Let me know if you face any issue.If the blog helped, please give it a like.


    Screenshot 2025-05-19 at 11.25.26 PM.pngScreenshot 2025-05-19 at 11.37.03 PM.pngScreenshot 2025-05-19 at 11.37.13 PM.pngScreenshot 2025-05-19 at 11.37.24 PM.png

        

Note:

If you are using Rest in Event setting then please include Recipients from Include Data as shown below.

 

Screenshot 2025-09-04 at 8.43.49 PM.png

 

 

Comments
sm001086602
Tera Contributor

@deepakverma12Thanks for sharing the article , it was really helpful but we are struck at one point

sm001086602_0-1752572352327.png

We cannot use Basic Authentication and DocuSign Team have also suggested to use OAuth.

So, can you please suggest the steps for the same.

sm001086602_1-1752572649090.png

 



deepakverma12
ServiceNow Employee
ServiceNow Employee

@sm001086602 

I never used OAuth but I have tried below steps and it is working fine.

Here’s the article I followed for this(Giga Guru comment's) : article 

Steps:

  •       Enable Client Credentials grant:  In System Properties (sys_properties.list), create/update:
    Name: glide.oauth.inbound.client.credential.grant_type.enabled  
    Type: true|false  
    Value: true

 

  • Create the Application Registry:

    • Navigate to System OAuth > Application Registry in ServiceNow.

    • Click New and select Create an OAuth API endpoint for external clients.

    • Fill out the name field only and save the form.

    • After saving, the system will automatically generate and populate the Client Secret.

  • Update OAuth Entity Configuration:

    • Go to System Definition > Scripts - Background.

    • Run the following script (update the sys_id and user values):

      var gr = new GlideRecord("oauth_entity");
      gr.get("07be8b30477ae250e4f15cf0516d4392"); // Replace with your actual sys_id of above record
      
      gr.setValue("default_grant_type", "client_credentials");
      gr.setValue("user", "6816f79cc0a8016401c5a33be04be441"); // Replace with the appropriate user sys_id(i have taken admin user's sys_id)
      gr.update();
  • Configure OAuth Settings in DocuSign:

    • In your DocuSign account, go to the OAuth 2.0 settings under Connect.

    • Enter the following:

      • Client ID: Use the Client ID generated in ServiceNow.

      • Client Secret: Use the Client Secret from ServiceNow.

      • Authorization Server URL:

        https://<your-instance-name>.service-now.com/oauth_token.do
         
  • Now select oauth instead of basic in Integration and Security Settings. 

This approach appears to work, though I’m not certain it’s the most best and recommended solution. Please test it thoroughly. 

sm001086602
Tera Contributor

@deepakverma12 we tried creating a OAuth profile and it worked but on the DocuSign end while sending the request they have an option to send the data either in both JSON or XML but when they are sending it via JSON Status comes as completed but via XML it shows Status as Completed ( ServiceNow is expecting this status)  is there a way whatever status they sent whether Completed or completed ServiceNow should accept it?

sm001086602
Tera Contributor

@deepakverma12  we tried creating a OAuth profile and it worked but on the DocuSign end while sending the request they have an option to send the data in both JSON and XML but when they are sending it via JSON Status comes as completed but via XML it shows Status as Completed ( ServiceNow is expecting this status)  is there a way whatever status they sent whether Completed or completed ServiceNow should accept it?

deepakverma12
ServiceNow Employee
ServiceNow Employee

@sm001086602 Could you please confirm which version of the 'Document Templates Integration with Docusign' app you are currently using? V1.6.4 version has handled this case sensitivity. Can you name the subflow where it stuck? Are you using Rest api instead of legacy?

sm001086602
Tera Contributor

@deepakverma12 please find the details in the screenshot attached

sm001086602_0-1753198264833.png

Subflow Name - DT Manage Task for Docusign

In the 8th step it is expecting the status as Completed 

sm001086602_1-1753198474845.png


but via XML it comes as Completed but via JSON it is coming as completed

 

deepakverma12
ServiceNow Employee
ServiceNow Employee

@sm001086602 what is the version of app are you using, and are you working with the REST API? Use 1.6.4 version if you are on lower version.

sm001086602
Tera Contributor

@deepakverma12 we are using the latest version - 1.6.3

and we are using  REST API in DocuSign

deepakverma12
ServiceNow Employee
ServiceNow Employee

@sm001086602 Please use version 1.6.4, as it contains the fix. Please let me know if it fix.

Version history
Last update:
a week ago
Updated by:
Contributors