Query a result from a custom value
I'm attempting to have a field listed in my service desk for my technicians for a phone number to call back on. The phone number field has to be populated based on the query that returns back from the prior custom query and selection.
CUSTOM_1 query:select full_name from USER ORDER BY full_name
CUSTOM_2 query:select work_phone from USER WHERE user_name = %custom_2%
What should replace the %custom_2% ??
If I update the value selected from Custom_1, will custom_2 auto-update with the phone number?
Community Chosen Answer
Have you tried it? If it doesn't work, you might consider setting up two ticket rules to handle this (and use the Order field to ensure the full_name gets applied first). Here's one to help with the full_name (which I'm also using in my setup):
on Ticket Save
SELECT HD_TICKET.ID AS ID FROM HD_TICKET
JOIN USER S ON (S.ID = HD_TICKET.SUBMITTER_ID)
WHERE (HD_TICKET.HD_QUEUE_ID = 1 and HD_TICKET.SUBMITTER_ID <>0)
X Run an update query, using the results from the one above
UPDATE HD_TICKET T
JOIN USER S ON (S.ID = T.SUBMITTER_ID)
SET T.CUSTOM_FIELD_VALUE0 = S.FULL_NAME WHERE T.ID=<TICKET_IDS>
Hope that helps!