Community Alums
Not applicable

Hello,

If you haven't used the new feature Policy and Compliance Integrator, roll your sleeves up - this is a game changer. Forget about transform maps to import Authority Documents, Citations and Control Objectives, this scripted REST api will do everything for you.

In addition to the article Using the GRC: Policy and Compliance integrator to display batch records and import tasks (serviceno..., I will share the Postman collection with APIs (which SN didn't share but they mentioned) so you can use and abuse.

Step 1 - Create a batch

  1. Go to Postman and create a new collection called "CIM API Collection".
  2. In the tab "Variables", create a new variable inside the collection called "instance" with value "https://YOUR_INSTANCE.service-now.com"
  3. In the tab "Authorization", set up your REST api user and password. Dont forget in order to create new batches you need to be a compliance admin. 
  4. Go to sn_grc_provider table and create a new provider called "communityProvider". If you don't do it, when you create a batch it will create a new Provider import task and you need to complete few more steps in order to get the new provider generated.
  5. Create a new POST method called "Create batch" with the following URL
    {{instance}}/api/sn_grc_cim/content/compliance/batch/create
    ​
    The body should be something like this:

 

{
"provider": "communityProvider",
"type": "compliance"
}
 

Save the batch number because you are going to use it to create staging records or any interaction with the API.

Step 2 - Create the staging records

  1. Go to Postman and inside your collection "CIM API Collection" create a new method called "Insert stagging records" with the following URL: "{{instance}}/api/sn_grc_cim/content/compliance/insert"
  2. The body should contain something like this:
    {"batch_number":"CIB0001008", "records": [{
      "document_id": "123456789",
      "name": "GRC Authority Document api",
      "description": "GRC Authority Document API",
      "citations": [{
         "document_id": "123456789",
        "name": "GRC Citation api",
        "control_objectives": [
            {
               "document_id": "123456789",
               "name": "GRC Control Objective api"
            }
        ]
      }]
    }]}

 This code will generate one AD, one citation and one control objective.

3. Update batch to ready

  1. Go to Postman and inside your collection "CIM API Collection" create a new method called "Update batch status to ready" with the following URL: "{{instance}}/api/sn_grc_cim/content/compliance/batch/ready"
The body should contain something like this:
{
    "batch_number": "CIB0001008"
}

 

The end result should be something like this:

find_real_file.png

 

3. Kick process, review task and complete process

  1. After this moment you need to kick the process by going to the Flow Designer, search for "Compliance staging processor" and run. Check the flow designer how often this process runs. Out of the box this runs weekly basis, every Monday. A new import task will be created after the flow has been executed.
  2.  Go to "Library import task" and review the staging records if necessary. At this stage, you can add an approver, or approver group, etc etc.
  3. The new authority document with citations and control objectives will be created when the import task is completed.

 

If you need anything, please let me know and I can share the Postman collection to save you some time.

Comments
Sebastien Fix1
Kilo Expert

Really nice rafa! Sharing with the team right away

Community Alums
Not applicable

Thanks @Sebastien Fix1, sharing is caring 😁

Varun Sareen
Tera Contributor

@Community Alums  Could you also please provide a Request Body example or a sample JSON code for GET method for the Compliance Content scripted API?

Bhupinder Singh
Tera Contributor

@Community Alums Thanks for sharing. Do you know if the Policy documents can be imported by using the provided APIs?

Community Alums
Not applicable

Web capture_31-10-2023_95815_wrangu.postman.co.jpegWeb capture_31-10-2023_95826_wrangu.postman.co.jpeg

Version history
Last update:
‎06-14-2022 05:25 AM
Updated by:
Community Alums