Custom ticket rule
I have a question, is possible create a custom ticket rule, where the condition was the fields of the LDAP users, and automatically update some fields in the ticket? , due to the wizard don´t have the fields of the user, is very difficult create this condition.
The wizard is so useless to me I forgot it was even there.
To answer your question.. yes.. it is possible, I do it so the title of the submitter is known to out techs. I simply copy the title from an ldap update to a custom field and in the template I make that custom field read only.
Here is the update portion:
T.CUSTOM_FIELD_VALUE133 = (
join ORG1.USER_FIELD_VALUE UFV ON UFV.USER_ID = T.SUBMITTER_ID
T.ID in (<TICKET_IDS>) AND
UFV.FIELD_ID = "2"
T.ID = <TICKET_IDS>
to build on barchetta point here is the custom ticket rule I came up with it updates three or more custom fields using data from LDAP, but in addition, it only updates the field if the person logging the ticket did not input any additional data collected.
CUSTOM_FIELD_VALUE2 = Coalesce(NULLIF(CUSTOM_FIELD_VALUE2, ''), (SELECT WORK_PHONE FROM USER where USER.ID = HD_TICKET.SUBMITTER_ID LIMIT 1)),
CUSTOM_FIELD_VALUE0 = Coalesce(NULLIF(CUSTOM_FIELD_VALUE0, ''), (SELECT FIELD_VALUE FROM USER_FIELD_VALUE where USER_ID = HD_TICKET.SUBMITTER_ID and FIELD_ID = 1 LIMIT 1)),
CUSTOM_FIELD_VALUE1 = Coalesce(NULLIF(CUSTOM_FIELD_VALUE1, ''), (SELECT FIELD_VALUE FROM USER_FIELD_VALUE where USER_ID = HD_TICKET.SUBMITTER_ID and FIELD_ID = 2 LIMIT 1))
(HD_TICKET.ID in (<TICKET_IDS>))