Create a store app for a custom integration
- UpdatedAug 3, 2023
- 3 minutes to read
- Vancouver
- IT Asset Management
Publish your custom integration application on the ServiceNow Store to make it available for others to use.
Before you begin
Role required: admin
About this task
You must complete these steps so that your custom integration works correctly when other users download it from the ServiceNow Store.
Procedure
-
Create a fix script in your custom integration application.
When a new integration profile is created using your application, the subflows and connection alias you created are automatically linked to the profile through this fix script.
- Navigate to System Applications > Studio.
- Select your custom integration application.
-
On the Welcome to Studio page, click + Create
New.
The Create Application File dialog box opens.
- On the dialog box, search for and select Fix Script.
- Click Create.
-
On the Fix Script form, fill in the following fields.
Table 1. Fix Script form Field Value Name Name of the fix script. For example, Custom Integration Fix Script. Unloadable Option to create Customer Update [sys_update_xml] records when the fix script runs. Do not select this option. Application Your custom integration application. This field is populated automatically. Before Option that enables you to run the fix script before installing or upgrading the application. Do not select this option. Description Description of the fix script. -
Enter the following script in the Script field.
For the subflows and connection alias, replace the example ids with the real ids. You can find the id in the URL for each item.
new global.CustomIntegrationProfileUtils().createCustomIntegration({ name: 'Name', // choose a name for the integration downloadSubscriptionSubflow: '3a23e189a1400010fa9bed1383c83d38', //replace example id updateActivitySubflow: '77a66d23e5500010fa9bc9581d0c0f47', //replace example id reclamationSubflow: 'e62b672e39400010fa9b4845e477fe02', //replace example id connectionAlias: '629ad2bfdb1893005963ff041d961971' //replace example id });
Note: The update activity and reclamation subflows are not required. If you do not include a subflow to update activity, the integration does not get user activity unless your download subscription subflow includes user activity. If you do not include a reclamation subflow, the integration cannot deactivate SaaS user subscriptions. - Click Submit.
-
Create a cross scope privilege record.
This record allows the fix script you created to access the CustomIntegrationProfileUtils() script include.
- Navigate to System Applications > Application Cross-Scope Access.
- Click New.
-
On the form, fill in the fields.
Table 2. Cross scope privilege Field Value Source Scope Your custom integration application. This field is populated automatically.
To select a different application, click the Settings (
) icon on the banner frame of your ServiceNow instance. On the System Settings dialog box, select the Developer tab and then choose an application from the Application drop-down list.
Target Scope Application from which resources are being requested. Click the search ( ) icon to locate and select the Global application.
Target Name Name of the script include. Set this field to CustomIntegrationProfileUtils. Target Type Type of request. Select Script Include. Application Your custom integration application. This field is populated automatically. Operation Operation that the script performs on the target scope. Select Execute API. Status Authorization for this cross scope privilege record. Select Allowed. - Click Submit.
What to do next
Before you publish your custom integration application on the ServiceNow Store, make sure that your actions and subflows are active, published, and saved in your application.