anyways to pull IP address
any possibility to pull IP address of the user machine into Helpdesk page?
0 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
chucksteel
7 years ago
Top Answer
Yes, this is possible using a custom rule. The update statement would look like this:
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE10 = (select IP FROM MACHINE where ID = MACHINE) where
T.ID = <TICKET_IDS>;
I would set the default value of the custom field to 'Set on Save' and then use a select statement that matches tickets with 'Set on Save' as the value. You might also want to have the select statement only match tickets with a MACHINE_ID not equal zero.
SELECT * FROM HD_TICKET WHERE CUSTOM_FIELD_VALUE10 = 'Set on Save' and MACHINE_ID != 0
Comments:
-
Thanks a lot Chuck, You Rock... - rahimpal 7 years ago
-
this my actual update statement
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE5 = (select CUSTOM_2 FROM USER where ID = SUBMITTER_ID) where
T.ID = <TICKET_IDS>; but i want to trim the characters so using this query
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(custom_2,',OU=',-1),',O=',1), custom_2 FROM ORG1.USER where custom_2 <> ''
getting error when I add this to current query
update HD_TICKET as T
set T.CUSTOM_FIELD_VALUE5 = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(custom_2,',OU=',-1),',O=',1), custom_2 FROM ORG1.USER where custom_2 <> ''
where ID = SUBMITTER_ID) where
T.ID = <TICKET_IDS>;
purpose of trimming the CUSTOM_2 field ; check the below link
http://cubeupload.com/im/X3Tubs.jpg
error shown in appliance
05/06/2016 01:09:04> Starting: 05/06/2016 01:09:04 05/06/2016 01:09:04> Executing Select Query... 05/06/2016 01:09:04> selected 1 rows 05/06/2016 01:09:04> Executing Update Query... 05/06/2016 01:09:04> mysqli error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where ID = SUBMITTER_ID) where T.ID = 98' at line 2] in EXECUTE("update HD_TICKET as T set T.CUSTOM_FIELD_VALUE8 = (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(custom_2,',OU=',-1),',O=',1), custom_2 FROM USER where custom_2 <> '' where ID = SUBMITTER_ID) where T.ID = 98;") 05/06/2016 01:09:04> Ending: 05/06/2016 01:09:04 - rahimpal 7 years ago-
Your original question was about a machine IP address but this is pulling OU information from the user table, so I'm not sure what you're trying to accomplish. - chucksteel 7 years ago
-
yes, im trying to trim the characters since it looks like this CN=USER,OU=CHICAGO,OU=AMERICA
im able to execute this on mysql workbench but throwing error in Appliance
CUSTOM_2 field in Ticketing page is used for finding user location which looks like CN=USER,OU=CHICAGO,OU=AMERICA
instead i want it to look like AMERICA or Chicago..query work but throws error in
appliance - rahimpal 7 years ago -
no worries, we fixed it...thanks for all the help u have been doing....and ur inputs have helped me a lot - rahimpal 7 years ago