Link AD attributes to newly created ticket
Hi there,
I am trying to get LDAP attributes that sync over from our Active Directory, such as manager, department code, and phone number, to automatically be populated in fields of a new ticket as we select the user. I was able to get these details in under the users table in the configuration settings using LDAP. In the "Define mapping between User attributes and LDAP attributes" was able to assign the manager to the manager field, phone to the work phone field and departmental code one of the custom fields called Custom 1. And if this is even possible, how do I use these attributes and have them automatically populate fields in the tickets technicians create. Custom ticket rules? If so, how would this look like and how do I set this up.
Thanks,
Adrian
Answers (1)
See my answer on this post for setting the location: https://www.itninja.com/question/dynamic-location-field
I recommend creating a rule for each ticket field that you want to set.
For settings in the USER table you the query is simpler. Here is the MANAGER_ID as an example:
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE10 = (
select MANAGER_ID FROM USER
where USER.ID = SUBMITTER_ID ) where
T.ID = <TICKET_IDS>;
Custom fields are a bit more complicated because they are in a separate table USER_FIELD_VALUE. To know which field you want, look at the USER_FIELD_DEFINITION table. On my SMA the Department is ID = 4, so the update query is:
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE0 = (select FIELD_VALUE FROM USER_FIELD_VALUE where USER_ID = SUBMITTER_ID and FIELD_ID = 4) where
T.ID = <TICKET_IDS>;
Remember that the custom ticket fields are zero based in the database, so custom ticket field 1 is CUSTOM_FIELD_VALUE0 in the database.