/bundles/itninjaweb/img/Breadcrumb_cap_w.png
We just updated to the latest version of K1000 server and I see the documents about the changes but I don't understand how to get my UPDATE query to work on my rule to add a site location-being pushed from AD. 
Can anyone provide a bit more guidance?
Here is what I have now (to add a site location-being pushed from AD):

SELECT HD_TICKET.ID AS ID FROM HD_TICKET 
JOIN USER S ON (S.ID = HD_TICKET.SUBMITTER_ID) 
WHERE HD_TICKET.SUBMITTER_ID <>0

Update Query:
UPDATE HD_TICKET T
JOIN USER S ON (S.ID = T.SUBMITTER_ID)
SET T.CUSTOM_FIELD_VALUE1 = S.LOCATION WHERE T.ID=<TICKET_IDS>

I see that the column is no longer located where it was but I cannot figure out the proper SQL syntax.  It seems to fail on the UPDATE Query according to the logs.

New Location of Custom Fields
(this is from the support document)
SELECT
  USER.FULL_NAME,
  ASSET.NAME
FROM
  USER
  JOIN ASSET on USER.LOCATION_ID = ASSET.ID

Thanks,
Jim
Answer Summary:
Cancel
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Answer Chosen by the Author


Answers

0
SOLUTION:

Update Query

UPDATE HD_TICKET T
JOIN USER S ON (S.ID = T.SUBMITTER_ID)
JOIN ASSET A ON (A.ID = S.LOCATION_ID)
SET T.CUSTOM_FIELD_VALUE1 = A.NAME WHERE T.ID=<TICKET_IDS>

Figured out with some assistance.

Answered 06/06/2017 by: civilnj
Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Answers

Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share