14. 09. 2012 Thomas Forrer Service Management

New OTRS add-ons: drop down from DB and text area from DB

In OTRS it is not possible to retrieve data from external DB, for this reason I have recently developed two new add-ons able to query directly on a database at runtime to fill in “possible values”. These add-ons are two new instances of dynamic fields in OTRS 3.1.x: a drop down from DB and a text area from DB.

Thanks to this implementation it is possible to configure the query with specific parameters extracted from other fields/dynamic fields at runtime (for example during the creation of a new phone ticket or on the split of a ticket). The query is performed using the build-in OTRS cache, so every parameter will be retrieved from the cache itself.

Another useful feature is, for instance, that if in the environment there is installed the OTRSTicketMaskExtension add-on you can also manage the dependences among the fields in the same way as using ACL.

A possible scenario in which the add-on can be used is – for example – if you want to display a field with a list of assets from the GLPI database. During the creation of a phone-ticket for an hardware failure it is posible to select all the “possible values” that are listed depending on the specified customer and asset.

If you need more information on these add-ons, feel free to contact us through the blog. 😉

Thomas Forrer

Thomas Forrer

Team Leader Research & Development at Würth Phoenix
Hi folks! I began loving computer since 1994, it was still the time of windows 3.1. Immediately I learned starting DOS games from the command promt, and while typing some white text on black background I felt like some hackish dude in a hollywoodian movie. Later during the studies at the university, I discovered the magic world of opensource, and it was love at first sight. Finally I got rid of BSOD's =) I love everything that is connected to some network, especially in a security perspective. My motto is: "With motivation, nothing is impossibile. It only requires more time."

Author

Thomas Forrer

Hi folks! I began loving computer since 1994, it was still the time of windows 3.1. Immediately I learned starting DOS games from the command promt, and while typing some white text on black background I felt like some hackish dude in a hollywoodian movie. Later during the studies at the university, I discovered the magic world of opensource, and it was love at first sight. Finally I got rid of BSOD's =) I love everything that is connected to some network, especially in a security perspective. My motto is: "With motivation, nothing is impossibile. It only requires more time."

25 Replies to “New OTRS add-ons: drop down from DB and text area from DB”

  1. Girish says:

    Hi,
    the add-on looks great! is it available for download?

    1. Arianna Cunaccia says:

      Hi Girish,
      in the next days we will publish the add-on in the download area of the blog. We’ll let you know when the package is available.

      1. Girish says:

        Hi again..
        Is it available for download now?

        1. Arianna Cunaccia says:

          Hi Girish,

          the add-on is available in the downloads are of the blog, or you can directly get the .opm from this link

  2. Alain says:

    Hi,

    Is it available for download?

    Thanks in advance,

    Alain

    1. Arianna Cunaccia says:

      Dear Alain,

      the add-on is available in the “Downloads” area of the blog, or you can directly get the .opm from this link

      1. Patricio says:

        Hello

        So., i copy pasted the files inside my otrs folders (each file in the correspondent folder)

        But now.., i dont know what to do with the patch folder. Where does this file go? How to I install it?

        It actually displays the dynamic field options and everything but in the agent ticket phone it does not display the results, Altough when inspected with firefox it does shows the id number but not the name which is also a column from the table.

        I am also not sure whether I have the add on of the ticket mask.., how can I get this?

        Sorry.., I am a noob…

        Kind Regards
        Cheers
        Patrick

        1. Patricio says:

          Here is the error log. , hope you guys can guide me a bit…., regards! 🙂

          e: Use of uninitialized value in concatenation (.) or string at /opt/otrs/Custom/Kernel/System/DynamicField/Backend/DropdownFromDB.pm line 1010.
          [Mon Dec 3 08:19:52 2012] -e: Use of uninitialized value in length at /opt/otrs/Custom/Kernel/System/DynamicField/Backend/DropdownFromDB.pm line 1012.
          [Mon Dec 3 08:25:05 2012] -e: Use of uninitialized value in split at /opt/otrs/Custom/Kernel/System/DynamicField/Backend/DropdownFromDB.pm line 860.

          1. Hi Patricio,

            you must pass the ‘%GetParam’ hash and the ‘ParamObject’ to every ‘AJAXPossibleValuesGet’ call inside the corresponding AgentTicketXXX.pm class in which you want to use the DropDownFromDB functionalities with passed parameters.

  3. Arianna Cunaccia says:

    hi everyone,

    I would like to inform you that there is a new update available for the Add-on OTRS-DynamicsFiledFromDB. You can find the latest update of the add-on in the “Build” folder from the following link

    or you can access it directly from the Download area of the blog.

    1. I need to make a switch between two Dynamic DB, help!

      1. Hi Joseph,
        What do you mean with ‘make a switch’?
        You can use the selected value from one DynamicFieldFromDB in the query of another DynamicFieldFromDB like any other Field by putting the correct name (e.g. DynamicField_) into the Parameter list.

        1. Joseph says:

          Hi Thomas,

          I want to use a parameter from another dynamicfield.
          I tried using “?” for call the parameter but it doesn´t work (e.g. SELECT ID, AREA FROM AREAS WHERE ID_PADRE = ?).

          Besides I have not available the parameter field. Can you tell me where can I find the parameters list you explain before?

          1. Hi Joseph,

            you can dump the available DynamicField list by enabling the debug mode at line:

            https://github.com/WuerthPhoenix/OTRS-DynamicFieldFromDB/blob/master/src/trunk/Custom/Kernel/System/DynamicField/Backend/DropdownFromDB.pm#L889

            and by putting a line

            print ERRLOG Dumper($Param{ParamObject}->{Query}->{param}) if $DEBUG;

            after line 896.

            This way a file named DF_ is created under /tmp with debug information, and at each call a dump of possible parameters list is written into it.

            In future releases we hope that this will be graphically available by enabling the ‘debug mode’ in the configuration.

            Kind Regards

          2. joseph says:

            Hi Thomas,

            How I can activate the field parameters?
            How I can register parameter?

            You can help, please.

  4. Andy says:

    Hi,
    I try to input a parameter (?) placeholder in the query for the drop down dynamic field, but I am getting this error instead: Wrong number of parameters, please check settings.

    Thanks in advance,
    Andy

    1. Hi Andy,

      You must specify a parameter name in the ‘parameters list’ for each placeholder (?) you specify in the query. If the number of both does not match you get this error.

      1. Andy says:

        Hi Thomas,

        Do you specific the parameter name in the ‘Parameters’ field in the settings?
        May I know what should be specific in the ‘Parameters’ field? Is it refers to field name?

        Thanks,
        Andy

      2. Pedro Tavares says:

        How i can configure the parameters list ?

        Thank you very much

  5. MrT says:

    Hello!
    Does it work with 3.3.4 also with full functions.

    1. Hi,

      we currently don’t support the new 3.3.x version of OTRS.
      We will port the code to the new API as soon as we need it.
      Stay tuned!

      Kind Regards.

  6. Vanessa says:

    Hi Tomas, I have the same error that Patricio, I’m not a developer, I’m a network administrator, so, could you post some exemple of configuration? Witch files do I have to change… Lines… Variables…

    1. Hi Vanessa,

      you can find examples and descriptions for every option in the configuration Panel under each field!

      Bye

  7. Rafaela says:

    Hi Thomas,
    it supports version 3.2 of OTRS or lower?

    Thanks,

    1. Hi Rafaela,

      yes, the Plugin was initially developed for version 3.1.x of OTRS, and then ported/enhanced for newer versions of OTRS/EriZone.

      Bye

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive