<classid="UserRequest"><fields><fieldid="last_updater"xsi:type="AttributeExternalKey"_delta="define"><sql>lastupdater_id</sql><target_class>Person</target_class><is_null_allowed>true</is_null_allowed><on_target_delete>DEL_MANUAL</on_target_delete><allow_target_creation>false</allow_target_creation></field></fields><presentation><details><items><itemid="col:col2"_delta="must_exist"><items><itemid="fieldset:Ticket:contact"_delta="must_exist"><items><itemid="last_updater"_delta="define"><rank>31</rank></item></items></item></items></item></items></details></presentation></class><classid="MailInboxStandard"><parent>MailInboxStandard</parent><methods><methodid="BeforeUpdateTicket"><static>false</static><access>protected</access><type>Overload-DBObject</type><code><![CDATA[ protected function BeforeUpdateTicket(Ticket $oTicket, EmailMessage $oEmail, Contact $oCaller) { // Get the contact ID $contactId = $oCaller->GetKey(); IssueLog::Info("Caller ID: " . $contactId); // Set the last_updater field to the contact ID $oTicket->Set("last_updater", $contactId); } ]]></code></method></methods></class>
Hello!
I'm trying to create an extension to be able to get the last person who emailed a ticket into a field of the user request ticket. I'm using Combodo email synchro and a custom extension to do this. My issue is that the function BeforeUpdateTicket does not seem to be called since I am not getting any updates to error.log or actual updates to the ticket after an email is received. I'm trying to replace the stub implementation: https://github.com/Combodo/itop-standard-email-synchro/blob/94aca081de28f5f6f45fb485cfa171cfcf10837a/datamodel.itop-standard-email-synchro.xml#L908
Heres the extension:
In the dependencies I've added:
Hi Cyro,
It looks like you're missing a
_delta
attribute on your<method>
element.Try adding
_delta="redefine"
and let us know if it worksHope this helps
Stephen
Heya!
Thank you, I can't believe I didn't notice that it was missing! It works perfectly now. 😊