Menu

Email when ticket,incident Log updated

2012-12-06
2013-02-23
  • Pankaj khurana

    Pankaj khurana - 2012-12-06

    Hello,

    I want if any user,admin modify Ticket,incident Log then e-mail should be go to support team,caller or other defined person.
    Please help me to solve this issue,its urgent.
    Thanks in advance

     
  • TheBigOne

    TheBigOne - 2012-12-06

    It`s bad to say but I would first read the documentation. You need to create a trigger and an action for this. There are already predefined trigger and actions you can use for this. Check: Admin Tools -> Notifications and the Wiki.

     
  • Pankaj khurana

    Pankaj khurana - 2012-12-06

    Thanks Sir

    You are right sir,its works fine only for portal user  when portal user update a log its email generated and reaches to defined person/group.But when admin update a Log,its email is not generated….

    I have checked a trigger and  try a create a new trigger for updatian,dropdown box show trigger only for portal (Trigger(when update from portal)).
    Might be i am confused but i have check properly and carefully.

    Thanks and Regards
    Pankaj

     
  • TheBigOne

    TheBigOne - 2012-12-06

    Hi This is of course a different question :)
    Here is a patch for the UI.php which creates an additional Trigger.

    Subject:  Added trigger call in UI.php to send message if log entry in Request form

    --
    htdocs/pages/UI.php |   13 ++++++++++++-
    1 files changed, 12 insertions(+), 1 deletions(-)

    diff -git a/htdocs/pages/UI.php b/htdocs/pages/UI.php
    index 329c046..c176b98 100644
    -- a/htdocs/pages/UI.php
    +++ b/htdocs/pages/UI.php
    @@ -1258,6 +1258,17 @@ EOF
                                                    utils::RemoveTransaction($sTransactionId);

                                                    $oP->p(Dict::Format('UI:Class_Object_Updated', MetaModel::GetName(get_class($oObj)), $oObj->GetName()));
    +
    +                                               // Trigger ?
    +                                               // modified by admin 08.10.2012
    +                                               $aClasses = MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL);
    +                                               $sClassList = implode(", ", CMDBSource::Quote($aClasses));
    +                                               $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT TriggerOnPortalUpdate AS t WHERE t.target_class IN ($sClassList)"));
    +                                               while ($oTrigger = $oSet->Fetch())
    +                                               {
    +                                                       $oTrigger->DoActivate($oObj->ToArgs('this'));
    +                                               }
    +
                                            }
                                            else
                                            {
    @@ -2260,4 +2271,4 @@ catch(Exception $e)
                    IssueLog::Error($e->getMessage());
            }
    }
    -?>
    \ No newline at end of file
    +?>
    -
    1.7.1

     
  • Fedor van der Burgt

    How does this patch work. What should I do?

     
  • TheBigOne

    TheBigOne - 2012-12-06

    On linux you can just use the "patch" command. It describes the differences between the original and the new file.

    Here are the line numbers from version 1.2.1
    Directly behind the following line 1260:

    $oP->p(Dict::Format('UI:Class_Object_Updated', MetaModel::GetName(get_class($oObj)), $oObj->GetName()        ));
    
     1262                                                 // Trigger ?
       1263                                                 // modified by ssc 08.10.2012
       1264                                                 $aClasses = MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL);
       1265                                                 $sClassList = implode(", ", CMDBSource::Quote($aClasses));
       1266                                                 $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT TriggerOnPortalUpdate AS t WHERE t.target_cla        ss IN ($sClassList)"));
       1267                                                 while ($oTrigger = $oSet->Fetch())
       1268                                                 {
       1269                                                         $oTrigger->DoActivate($oObj->ToArgs('this'));
       1270                                                 }
       1271
    
     
    • Anonymous

      Anonymous - 2013-02-23

      Is there any chance that you may have also done this update in version 2.0?

      Thanks in advance... :)

       
  • Pankaj khurana

    Pankaj khurana - 2012-12-12

    Dear Johndoe2011,

    I have tried  to follow your step but i am not succed still now.could you done this ever.if yes please guide me to fix this issue.its so urgent
    Thanks in advance
    Regards
    Pankaj khurana

     
  • TheBigOne

    TheBigOne - 2012-12-12

    Hi,

    I know everything is urgent in IT.

    The code above is exactly what I`ve changed in the code to get it working. You need to create a notification with a "Trigger on Portal update" and an action to send a notification. The code above is just calling the "Trigger on Portal update" even if the Agent is changing the log.

    I`ve checked our GIT repo and I`m pretty sure that I did not change anything else in the core of iTop to get it working.

    You should always provide a bit more information than just saying its urgent and that its not working.

    I`m not an iTop developer, I just try to understand the code and follow the try and error learning path ;)
    Maybe you should spend more time on reverse engineering and debugging.

     
  • Pankaj khurana

    Pankaj khurana - 2012-12-12

    Dear johndoe2011,

    thanks a lot sir,i know that is too bad to write its urgent and that is not working.I am sorry for this,but you are great supporter for me in itop development,that why i am requesting to you .if you feel bad i am aplogoies for this.

    thanks

     
  • TheBigOne

    TheBigOne - 2012-12-12

    That`s not the problem, I don`t feel bad. It`s just a bit difficult to find the problem without an information about the configuration :)

     
  • Pankaj khurana

    Pankaj khurana - 2012-12-17

    Thanks Stefen Sir,

    I have done above task also ..To follow your code and suggestion ….thanks a lot…

    With Best Regards
    Pankaj Khurana

     

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.