There are two department fields in the user records. One from AD and the other one from nService. Use this python script to populate the department list
When a service request is created, its department ID is set to the department ID of the submitter. There are two department fields in the user accounts, one from Active Directory, the other one from nService. To link the departments from AD to the department list in nService, run the attached python script.

You would first need to install python, then install pyodbc. Before running the script, correct the connection string to connect to your database. Update the Server and the Database field. If you are not using SQL Server integrated authentication, change the connection string to use UID and PWD.

conn = pyodbc.connect(
    'Driver={SQL Server};'
    'Server=localhost\\sqlexpress;'
    'Database=nService4;'
    'UID=the-sql-account-user-id;'
'PWD=the-sql-account-password;'
)

how to install python and pyodbc:

https://docs.microsoft.com/en-us/sql/connect/python/pyodbc/step-1-configure-development-environment-for-pyodbc-python-development?view=sql-server-ver15

To run the attached dept-bridge script, type:

python dept-bridge.py


Keep in mind that you would need to run this script when you have a new employee or when someone changes departments.

Article #1514
Attachments:
dept-bridge.py (1600 bytes)
Updated On: 4/24/2020 Index
Was this article helpful? Yes | No