ServiceDesk

 View Only
  • 1.  Variable in SQL queries used in reports/web parts

    Posted Mar 17, 2015 08:09 AM

    I am trying to come up with a way of listing the tickets that are owned by the currently logged in user and any tickets that have not been responded to that are assigned to their queues.

    Looking at the report builder I cannot see a way of creating this report so was planning to resort to SQL query writing. However I need to subsitiute the user name at query run time with the name of the person logged in the portal session. Usually Service Desk systems provide set variables that can be used, e.g. $CurrentUser$ but I cannot find anything similar for SD. Am I missing something somewhere, or can someone advise/help?

     

    Thanks in advance

     

    Steve



  • 2.  RE: Variable in SQL queries used in reports/web parts

    Posted Mar 17, 2015 01:53 PM

    There should be a SQL with Parameters option that allows you to do this (nested beneath SQL as a report type). There is an option to specify CurrentUser as well.



  • 3.  RE: Variable in SQL queries used in reports/web parts

    Posted Mar 17, 2015 01:58 PM

    Thanks. I had noted that and tried to work out how it worked without a lot of sccuess. Is there any documentation for this? 



  • 4.  RE: Variable in SQL queries used in reports/web parts

    Posted Mar 17, 2015 03:37 PM

    I believe you indicate parameters in your SQL query by using the @blah, where blah would be the variable name. Once you pump in your SQL string, click the button to detect the variables. Then, at run-time, you can supply values (or use the current logged-in user if specified, etc.)