Adding custom attributes
ServiceNow support custom fields for user object. The adapters supports only the standard set of attributes but you can customize the adapter to support custom attributes.
Procedure
-
Copy the adapter profile JAR file and extract the files.
- Download the adapter package from the IBM® Passport Advantage® website.
- Copy the ServiceNowProfile.jar file, which is included in the adapter package, into a temporary directory.
-
Run the following command to extract the contents of the
ServiceNowProfile.jar file:
cd c:\temp jar -xvf ServiceNowProfile.jar
The jar command creates the c:\temp\ServiceNowProfile directory.
The JAR file contains a ServiceNowProfile folder with the following files:- CustomLabels.properties
- erServiceNowAccount.xml
- erServiceNowService.xml
- schema.dsml
- service.def
- servicenowAL.xml
-
Update the schema.dsml file, which identifies all of the standard user
account attributes. Modify the file to identify new custom attributes.
- Open schema.dsml in a text editor.
-
Add the custom attribute at the end of attributes.
For example:
<attribute-type single-value="true"> <name>erServiceNowCustomAttribute</name> <object-identifier>1.3.6.1.4.1.6054.3.177.2.1001</object-identifier> <syntax>1.3.6.1.4.1.1466.115.121.1.15</syntax> </attribute-type>
Note:- In the attribute-type, use single-value to indicate whether the attribute is single-value or multi-value.
- The attribute name must start with a prefix erServiceNow to easily identify the attributes that are used with IBM Security Verify Governance Identity Manager.
- The Object Identifier (OID) is increased by 1. Start a new range of number for custom attribute to avoid OID conflicts with future version of adapters. For example, you can start your attribute OID from 1.3.6.1.4.1.6054.3.177.2.1000, so the first attribute OID is 1.3.6.1.4.1.6054.3.177.2.1001. An error message is displayed if there is any conflict in the OID.
-
If the custom field references another table, define the field as supporting data.
Verify the page URL to determine what the custom field references from the ServiceNow UI. For example, https://XXX.service-now.com/cmn_department_list.do?sysparm_target=sys_user.department&sysparm_target_value=1231342432&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=department&sysparm_reference=cmn_department&sysparm_view=sys_ref_list&sysparm_additional_qual=&sysparm_dependent=&sysparm_domain_restore=falseNote:
The referenced table is shown as
sysparm_reference=cmn_department
. The value fordepartment
is referring to theSYSID
incmn_department
, and displays theName
fromcmn_department
.There must be an attributeerServiceNowDepartment
inerServiceNowAccount
object class to represent the Department Field on ServiceNow. The adapter also needs an object class to store theSYSID
andName
in LDAP. For example, the object class for the department supporting data in the adapter:<class superior="top"> <name>erServiceNowDepartmentClass</name> <description>Department supporting data</description> <object-identifier>1.3.6.1.4.1.6054.3.177.1.5</object-identifier> <attribute ref="erServiceNowDepartmentSysID" required="true"/> <attribute ref="erServiceNowDepartmentName" required="false"/> </class>
The
erServiceNowDepartmentSysID
anderServiceNowDepartmentName
are referring to thecmn_department
table.The OID for custom filed object class must start from a new range, preferably from 1.3.6.1.4.1.6054.3.177.1.100 onwards.
-
Add the attribute and its label in the CustomLabels.properties file to
show the correct label on Adapter account form.
Use the format
attribute=label
.Note: The attribute name must be in lowercase. For example:erservicenowcustomattribute=Custom Field One
-
Modify the assembly lines to add new mappings for the custom attributes. The Assembly Lines in
servicenowAl.xml contain mapping instructions from IBM Security Verify
Governance Identity Manager request to
ServiceNow.
- Launch the Security Directory Integrator Configuration Editor.
- Select File > Open Security Directory Integrator Configuration File to open the servicenowAL.xml.
- Select snAdd > addUser, which contains the mapping for the Add user operation.
- In the OutputMap, add the name of the custom field exactly as the API Name on ServiceNow.
-
Change the default value of
work.[custom field name]
towork.[custom attribute name]
. For example.work.u_custom_field
towork.erServiceNowCustomAttribute
. - Add the attribute to snModify > Output Map.
- Add the attribute to snRecon. Select searchUser and add the custom attribute.
-
In the Input Map, set Work Attribute as
erServiceNowCustomAttribute
and Assignment asconn.u_custom_field
. - Save and export back to servicenowAL.xml.
-
Create a JAR file and install the new adapter profile.
-
Create a JAR file using the files in the \temp directory. Run the
following commands:
cd c:\temp jar -cvf ServiceNowProfile.jar ServiceNowProfile
- Import the ServiceNowProfile.jar file into the Identity server.
-
Restart the dispatcher.
Note: See the LDAP and trace logs if there is a problem loading the profile.
-
Create a JAR file using the files in the \temp directory. Run the
following commands:
-
Modify the adapter form to view or edit the new custom attribute. Otherwise, the attribute is
not displayed even if the Assembly Lines work.
You can set the attribute value type according to the field type on ServiceNow.
For attribute with supporting data, set the type to DropDown Box. The filter must haveAttribute
as theName
orLabel
in the supporting data. TheSource
is theSYSID
, andFilter
is objectclass equals supporting data object class. For example:Attribute: erservicenowdepartmentname Source Attribute: erservicenowdepartmentsysid Filter:(objectclass=erservicenowdepartmentclass)
For more information about modifying account form, see the IBM Security Verify Governance Identity Manager product documentation.