/build/static/layout/Breadcrumb_cap_w.png

Custom ticket rule

Hi everyone,

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.

Thanks.


0 Comments   [ + ] Show comments

Answers (2)

Posted by: barchetta 1 year ago
4th Degree Black Belt
1

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:

update

HD_TICKET T

set

T.CUSTOM_FIELD_VALUE133 = (

select 

UFV.FIELD_VALUE 

FROM 

ORG1.HD_TICKET

join ORG1.USER_FIELD_VALUE UFV ON UFV.USER_ID = T.SUBMITTER_ID

WHERE 

T.ID in (<TICKET_IDS>) AND

UFV.FIELD_ID = "2"

LIMIT 1)

where

T.ID = <TICKET_IDS>


Posted by: gidemit 1 year ago
White Belt
0

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.


UPDATE HD_TICKET
SET
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))
where
  (HD_TICKET.ID in (<TICKET_IDS>))

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ