Menu

Ticket creation - Org_id based on caller_id on Itop3

2022-07-20
2022-08-17
  • Nicolas Hemery

    Nicolas Hemery - 2022-07-20

    Hello everyone,

    Long time user and customizer of Itop, I recently updated our old Itop 2.6.1 to Itop 3. I had updated the ticket creation behavior to get the organization based on the caller_id (see below).

    <field id="org_id" xsi:type="AttributeExternalKey" _delta="redefine">
        <sql>org_id</sql>
        <filter>SELECT Organization AS O JOIN Person AS P ON P.org_id = O.id WHERE P.id=:this->caller_id</filter>
        <dependencies>
            <attribute id="caller_id"/>
        </dependencies>
        <target_class>Organization</target_class>
        <is_null_allowed>false</is_null_allowed>
        <on_target_delete>DEL_AUTO</on_target_delete>
    </field>
    <field id="caller_id" xsi:type="AttributeExternalKey" _delta="redefine">
        <filter><![CDATA[SELECT Person WHERE status = 1]]></filter>
        <sql>caller_id</sql>
        <target_class>Person</target_class>
        <is_null_allowed>true</is_null_allowed>
        <on_target_delete>DEL_AUTO</on_target_delete>
    </field>
    

    It always worked just fine on older versions but on Itop3 I have to select the caller two times for it to work. I have other fields related to caller_id that don't update the first time either but if I remove the redefining of org_id everything works just fine (so I guess it is the culprit). Usually the first time I click the field org_id is filled with my own org_id, and the second time with the actual caller_id.

    Has someone be confronted to a similar issue ? Thanks in advance :)

     

    Last edit: Nicolas Hemery 2022-07-20
  • Nicolas Hemery

    Nicolas Hemery - 2022-07-22

    Hello,

    I finally fixed it, the problem wasn't my customization after all. I had to set the min_autocomplete_chars to 4. Each contact in a given organization has a 3 letters prefix (let's say Walmart => WLM001, WLM002 etc....) so I guess the request returns too many elements when autocompleting.

    The data structure was the same in Itop 2.6 so it's odd... But at least it works.

    Have a good day.

     
  • Pierre Goiffon

    Pierre Goiffon - 2022-08-17

    Thanks for the feedback, good to know !

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.