any possibility to pull  IP address of the user machine into Helpdesk page?
Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answer Chosen by the Author

0
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


Answered 05/03/2016 by: chucksteel
Red Belt

  • Thanks a lot Chuck, You Rock...
  • 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
    • 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.
      • 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
      • no worries, we fixed it...thanks for all the help u have been doing....and ur inputs have helped me a lot
  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
Please log in to comment

Answers

This content is currently hidden from public view.
Reason: Removed by member request
For more information, visit our FAQ's.

Answer this question or Comment on this question for clarity

Share