How can I save a custom field from the user table in a ticket
We are pulling in the accounting code of the department the user is in from active directory into our users table. I want the accounting code saved in the ticket record so we can report hours spent working on that accounting code. How can I accomplish this?
2 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
chucksteel
9 years ago
Here is the update statement I use to populate a service desk field with the user's location:
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE8 = (select LOCATION FROM USER where ID = SUBMITTER_ID) where
T.ID = <TICKET_IDS>;
To use a different field change the select statement to match that field:
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE8 = (select BUDGET_CODE FROM USER where ID = SUBMITTER_ID) where
T.ID = <TICKET_IDS>;
Another option is if your users go to the portal to send in tickets. Create a drop down with the various codes, besides accounting, and make it a required field they have to fill in before they can submit a ticket. - nshah 9 years ago
Update statement looks like this:
UPDATE
HD_TICKET Inner Join
USER On HD_TICKET.SUBMITTER_ID = USER.ID Inner SET HD_TICKET.CUSTOM_FIELD_VALUE8 = USER.BUDGET_CODE WHERE HD_TICKET.ID IN (<TICKET_IDS>)
How to get the right value for <TICKET_IDS> ? - mreigler 9 years ago