Assign Tenant based on Group using pdm_settenant

Document ID : KB000013590
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

Is it possible to set the Tenant on a ticket based on Group in bulk?

Answer:

The pdm_settenant command can be used to set the Tenant to an object based on group by modifying the settenant.xml file.

 

NOTE: The settenant.xml file can be found in the following directory.

$NX_ROOT\samples\multi_tenancy

 

EXAMPLE:

 

<Object name="cr">

 

<TenantRule type="Name">Service Provider</TenantRule>

 

<Where>tenant is null and group=U'CA4963375E920C43B56F2F1119C59B8F'</Where> 

 

</Object>

 

What the example above will do is look for any "Request/Incident/Problem" and set the Tenant to "Service Provider" if the Tenant is null for that ticket AND if the Group assigned to the ticket equals the contact_uuid.

 

The contact_uuid for a Group can be found on the ca_contact table and will have to be modified to match the example above.

Each contact_uuid begins with 0x and will need to be replaced with then with single quotes around the id.

 

In order for the pdm_setatant command to run properly the following files need to be in the $NX_ROOT/site/cfg directory:

buildtenant.xml
buildtenant.xsd
settenant.xml
settenant.xsd

 

Once the setteant.xml file has been modified accordingly, open a command prompt and cd to $NX_ROOT/site/cfg

And run "pdm_settenant -f settenant.xml -r"

 

After the command completes any Request/Incident/Problem which has the Group specified assigned and did not have a Tenant assigned, will now have the Tenant specified in the TenantRule assigned to it.