Also create an article to parent ticket

Moderator: crythias

Locked
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Also create an article to parent ticket

Post by ndhvu275 »

Hi everyone,

I had a requirement relates to parent/child ticket when split a ticket. For example
- There is a ticket A
- Create a child ticket B from splitting ticket A (parent ticket is B)
- Do an action on child ticket B (maybe: add note, close, pending, change queue, change priority...), it will be insert an article
=> The requirement is this article must be insert on parent ticket B as well.

I would to ask
- In OTRS, is it possible config in sysconfig? If you know, please show me
- Otherwise, cannot config => customization. Actually, I'm investigating about this. I found to orginal function to create article in system::ticket::article::ArticleCreate() and I think I have to modify this function, that's possible to insert article into parent ticket as well. But, I know that should not to do.
- Also about customization, is there anyway that's no need to modify original files. As I know, there is a way create event in System::Ticket::Event, but I'm reallly to understand how to do.

Anyone know, please help. Every idea/suggestion from you are good news to me.

Thanks in adv,

Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: Also create an article to parent ticket

Post by ndhvu275 »

Hi,

I've done with a customization. Btw, a dangerous that I had to modify the orignal file of OTRS in OTRS\Custom\Kernel\Modules\AgentTicketActionCommon.pm, however it's placed in Custom folder. And now, it's possible also create articles in parent ticket same articles from child ticket when I add note, change priority, set pending, close.
Below is the coding in AgentTicketActionCommon.pm (from BEGIN INFOdation -> END INFOdation), please check my coding, is there has any problems? Or how's about my solution?

Code: Select all

            my $From = "$Self->{UserFirstname} $Self->{UserLastname} <$Self->{UserEmail}>";
            my @NotifyUserIDs = ( @{ $Self->{InformUserID} }, @{ $Self->{InvolvedUserID} } );
            $ArticleID = $Self->{TicketObject}->ArticleCreate(
                TicketID                        => $Self->{TicketID},
                SenderType                      => 'agent',
                From                            => $From,
                MimeType                        => $MimeType,
                Charset                         => $Self->{LayoutObject}->{UserCharset},
                UserID                          => $Self->{UserID},
                HistoryType                     => $Self->{Config}->{HistoryType},
                HistoryComment                  => $Self->{Config}->{HistoryComment},
                ForceNotificationToUserID       => \@NotifyUserIDs,
                ExcludeMuteNotificationToUserID => \@NotifyDone,
                %GetParam,
            );
			
			#------------------------------------------------
			# BEGIN INFOdation
			#------------------------------------------------
			# check existing parent tickets
			my %LinkList = $Self->{LinkObject}->LinkKeyListWithData(
				Object1   => 'Ticket',
				Key1      => $Self->{TicketID},
				Object2   => 'Ticket',
				Type      => 'ParentChild',
				Direction => 'Source',
				State     => 'Valid',
				UserID    => $Self->{UserID},
			);
			
			# push article of child to parents
			if (%LinkList) {
				my $ParentArticleID = '';
				for my $TicketID ( keys %LinkList ) {
					# change the subject of note send to parent
					my $ParentTicketNumber = $Self->{TicketObject}->TicketNumberLookup(
						TicketID => $TicketID,
						UserID   => $Self->{UserID},
					);
					$GetParam{Subject} = $GetParam{Subject}." [Task#".$ParentTicketNumber." ]";
			
					# create articke for a parent
					$ParentArticleID = $Self->{TicketObject}->ArticleCreate(
						TicketID                        => $TicketID,
						SenderType                      => 'agent',
						From                            => $From,
						MimeType                        => $MimeType,
						Charset                         => $Self->{LayoutObject}->{UserCharset},
						UserID                          => $Self->{UserID},
						HistoryType                     => $Self->{Config}->{HistoryType},
						HistoryComment                  => $Self->{Config}->{HistoryComment},
						ForceNotificationToUserID       => \@NotifyUserIDs,
						ExcludeMuteNotificationToUserID => \@NotifyDone,
						%GetParam,
					);
					
					if ( !$ParentArticleID ) {
						return $Self->{LayoutObject}->ErrorScreen();
					}
				}		
			}			
			# END INFOdation --------------------------------

            if ( !$ArticleID ) {
                return $Self->{LayoutObject}->ErrorScreen();
            }
Thanks in adv

Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: Also create an article to parent ticket

Post by ndhvu275 »

Hi,

Anotherway, you can create event to do this. That's best solution I think

Hope this info will be helpful

Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
sunny
Znuny newbie
Posts: 68
Joined: 30 Aug 2011, 13:14
Znuny Version: 5.0.22
Real Name: Sunny
Contact:

Re: Also create an article to parent ticket

Post by sunny »

Hi ndhvu275,

I am using 3.0 so not able to do this as I am getting error when using your code..,..

And please let me know how to create a event for this?
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: Also create an article to parent ticket

Post by ndhvu275 »

sunny wrote:Hi ndhvu275,

I am using 3.0 so not able to do this as I am getting error when using your code..,..

And please let me know how to create a event for this?
Hi,

In folder /opt/otrs/Kernel/System/Ticket/Event, you create a new file (event file). For example the name is UpdateToParent.pm. Then you can reference my below coding
In my case, I defined some configurations in sysconfig that will copied to parent ticket
- What article types
- The number of recent articles if closing the parent
- The number of recent articles if pending the parent
- The mapping states of parent and child tickets
- No effect to master/slave tickets

Code: Select all

# --
# Kernel/System/Ticket/Event/UpdateToParent.pm - event module
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information.
# --

package Kernel::System::Ticket::Event::UpdateToParent;

use strict;
use warnings;
use Kernel::System::LinkObject;

sub new {
    my ( $Type, %Param ) = @_;

    # allocate new hash for object
    my $Self = {};
    bless( $Self, $Type );

    # get needed objects
    for (qw(ConfigObject TicketObject LogObject UserObject)) {
        $Self->{$_} = $Param{$_} || die "Got no $_!";
    }
	$Self->{LinkObject}      	= Kernel::System::LinkObject->new(%Param);

    return $Self;
}

sub Run {
    my ( $Self, %Param ) = @_;

    # check needed stuff
    for (qw(Data Event Config)) {
        if ( !$Param{$_} ) {
            $Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
            return;
        }
    }
	
    if ( $Param{Event} eq 'TicketStateUpdate' ) { #catch the event of updating ticket state
		# check the existing of parent tickets
		my %LinkList = $Self->{LinkObject}->LinkKeyListWithData(
			Object1   => 'Ticket',
			Key1      => $Param{Data}->{TicketID}, #current TicketID
			Object2   => 'Ticket',
			Type      => 'ParentChild',
			Direction => 'Source',
			State     => 'Valid',
			UserID    => 1,
		);
	
		if (%LinkList) {
			# get child ticket object
			my %ChildTicket = $Self->{TicketObject}->TicketGet(
				TicketID => $Param{Data}->{TicketID},
				UserID   => 1,
			);
			
			# get Article Types will be migrated from sysconfig			
			my %ArticleTypes = %{ $Self->{ConfigObject}->Get("Ticket::ArticleTypeOnChild") };			
			my @TypeOfArticleConfig;
			while (my ($key, $value) = each %ArticleTypes) {
				if ($value) {
					push(@TypeOfArticleConfig, $key);
				}
			}
				
			# get all Articles of child ticket will be migrated
			my @Articles = $Self->{TicketObject}->ArticleContentIndex(
				TicketID    => $Param{Data}->{TicketID},
				UserID      => 1,
				ArticleType => \@TypeOfArticleConfig,
			);
			
			# get the number of Articles will be migrated from sysconfig
			my $ArticleNumbers = 0;
			if ($ChildTicket{StateType} eq 'closed') {				
				$ArticleNumbers = $Self->{ConfigObject}->Get("Ticket::NumberRecentArticleOnCloseChild");
			}
			else {
				$ArticleNumbers = $Self->{ConfigObject}->Get("Ticket::NumberRecentArticleOnPendingChild");
			}
			
			# get number of recent articles in config
			my @RecentArticles;
			foreach (reverse @Articles) {
				push(@RecentArticles, $_);									
				$ArticleNumbers--;
				last if $ArticleNumbers<=0;
			}
				
			# get mapping states of parent and child ticket from sysconfig
			my %MappingState = %{ $Self->{ConfigObject}->Get("Ticket::ChildParentStateMapping") };
			# get state will be update for parent
			my $StateParent;
			if ($ChildTicket{State}) {
				$StateParent = $MappingState{$ChildTicket{State}};
			}
			
			# performed by OTRS Event
			#my %User = $Self->{UserObject}->GetUserData(UserID => $EventUserID,);
            # performed by current user
            my %User = $Self->{UserObject}->GetUserData(UserID => $Param{UserID},);
			my $From = "$User{UserFirstname} $User{UserLastname} <$User{UserEmail}>";
			
			# migrate foreach parent ticket
			for my $ParentTicketID ( keys %LinkList ) {
				# need to check parent ticket is not master ticket only, a slave is still accepted
				my %ParentTicket = $Self->{TicketObject}->TicketGet(
					TicketID => $ParentTicketID,
					DynamicFields => 1,
					UserID   => 1,
				);				
				next if (($ParentTicket{DynamicField_MasterSlave}) and ($ParentTicket{DynamicField_MasterSlave}) !~ m/^Slave.*/);
				
				# push articles of child to parents
				for my $Article (reverse @RecentArticles) {
					# create article for parent ticket
					my $ArticleID = $Self->{TicketObject}->ArticleCreate(
						TicketID         => $ParentTicketID,
						ArticleType      => $Article->{ArticleType},                        # email-external|email-internal|phone|fax|...
						SenderType       => $Article->{SenderType},                                # agent|system|customer
						From             => $From,       # not required but useful
						To               => $Article->{To}, # not required but useful
						Cc               => $Article->{Cc}, # not required but useful
						ReplyTo          => $Article->{ReplyTo}, # not required
						Subject          => $Article->{Subject}." [Task#".$ChildTicket{TicketNumber}."]",               # required
						Body             => $Article->{Body},                     # required
						MessageID        => $Article->{MessageID},          # not required but useful
						InReplyTo        => $Article->{InReplyTo},           # not required but useful
						References       => $Article->{References}, # not required but useful
						ContentType      => $Article->{ContentType},      # or optional Charset & MimeType
						HistoryType      => 'OwnerUpdate',                        # EmailCustomer|Move|AddNote|PriorityUpdate|WebRequestCustomer|...
						HistoryComment   => 'Article from child ticket',
                        UserID           => $Param{UserID},
						NoAgentNotify    => $Article->{NoAgentNotify},                                      # if you don't want to send agent notifications
						AutoResponseType => $Article->{AutoResponseType},                          # auto reject|auto follow up|auto reply/new ticket|auto remove
						ForceNotificationToUserID   => $Article->{ForceNotificationToUserID},               # if you want to force somebody
						ExcludeNotificationToUserID => $Article->{ExcludeNotificationToUserID},                   # if you want full exclude somebody from notfications,
																					# will also be removed in To: line of article,
																					# higher prio as ForceNotificationToUserID
						ExcludeMuteNotificationToUserID => $Article->{ExcludeMuteNotificationToUserID},               # the same as ExcludeNotificationToUserID but only the
																					# sending gets muted, agent will still shown in To:
																					# line of article
					);					
				}
				
				# update state for parent ticket
				if ($StateParent) {					
					$Self->{TicketObject}->TicketStateSet(
						TicketID => $ParentTicketID,
						State  => $StateParent,
                        UserID    => $Param{UserID},
					);
				}
			}
		}
    }

    return 1;
}

1;
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
Misfitz
Znuny newbie
Posts: 43
Joined: 22 Feb 2012, 16:21
Znuny Version: 3_3_3
Real Name: Patrick Veit
Company: Ametras mobility

Re: Also create an article to parent ticket

Post by Misfitz »

Hi ndhvu275,

if i copy your coding in my OTRS and i want to test it with a Parent/Child Ticket i become and "internal Server error" [Code500].

Do you have a How to for this steps?

I have a much of questions:

- I copied your coding into AgentTicketActionCommon.pm, than i tried to close a child ticket -> the internal server error appears.
- I create a new file (UpdateToParent.pm) and copied your code, than i tried to close a child ticket -> the internal server error appears.
- I copied your coding into AgentTicketActionCommon.pm again, than i tried to close a child ticket -> the internal server error appears.

Where is the mistake?

What should i do step by step?

I hope you can help me to coding this very useful Event. I need a event, that write a note into the parent ticket if anything is taken at the child tickets.

yours sincerely
Tadur
Znuny newbie
Posts: 6
Joined: 05 Oct 2015, 14:48
Znuny Version: 4.0.11

Re: Also create an article to parent ticket

Post by Tadur »

Ran into this topic aswell while searching for a solution:
I wanto update Parenttickets automatically when something is happening in their Childs. So Im working on implementing the solution from ndhvu275.

I understood your approach with the AgentTicketActionCommon.pm as one premature solution. So I was driving with you event approach from the beginning.

I created a file here:

OTRS path/Kernel/Config/Files/UpdateToParent.xml

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<otrs_config version="1.0" init="Changes">
    <ConfigItem Name="Ticket::EventModulePost###UpdateToParent"
Required="0" Valid="1">
        <Description Lang="en">Description</Description>
        <Group>UpdateToParent</Group>
        <SubGroup>UpdateToParent</SubGroup>
        <Setting>
            <Hash>
                <Item
Key="Module">Kernel::System::Ticket::Event::UpdateToParent</Item>
                <Item Key="Event">(ArticleCreate|TicketOwnerUpdate|TicketMerge|TicketCustomerUpdate|TicketStateUpdate)</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>

and here:

OTRS path/Custom/Kernel/Modules/AgentTicketChecklist.pm

Code: Select all

# --
# Kernel/System/Ticket/Event/UpdateToParent.pm - event module
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information.
# --

package Kernel::System::Ticket::Event::UpdateToParent;

use strict;
use warnings;
use Kernel::System::LinkObject;

sub new {
    my ( $Type, %Param ) = @_;

    # allocate new hash for object
    my $Self = {};
    bless( $Self, $Type );

    # get needed objects
    for (qw(ConfigObject TicketObject LogObject UserObject)) {
        $Self->{$_} = $Param{$_} || die "Got no $_!";
    }
   $Self->{LinkObject}         = Kernel::System::LinkObject->new(%Param);

    return $Self;
}

sub Run {
    my ( $Self, %Param ) = @_;

    # check needed stuff
    for (qw(Data Event Config)) {
        if ( !$Param{$_} ) {
            $Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
            return;
        }
    }
   
    if ( $Param{Event} eq 'TicketStateUpdate' ) { #catch the event of updating ticket state
      # check the existing of parent tickets
      my %LinkList = $Self->{LinkObject}->LinkKeyListWithData(
         Object1   => 'Ticket',
         Key1      => $Param{Data}->{TicketID}, #current TicketID
         Object2   => 'Ticket',
         Type      => 'ParentChild',
         Direction => 'Source',
         State     => 'Valid',
         UserID    => 1,
      );
   
      if (%LinkList) {
         # get child ticket object
         my %ChildTicket = $Self->{TicketObject}->TicketGet(
            TicketID => $Param{Data}->{TicketID},
            UserID   => 1,
         );
         
         # get Article Types will be migrated from sysconfig         
         my %ArticleTypes = %{ $Self->{ConfigObject}->Get("Ticket::ArticleTypeOnChild") };         
         my @TypeOfArticleConfig;
         while (my ($key, $value) = each %ArticleTypes) {
            if ($value) {
               push(@TypeOfArticleConfig, $key);
            }
         }
            
         # get all Articles of child ticket will be migrated
         my @Articles = $Self->{TicketObject}->ArticleContentIndex(
            TicketID    => $Param{Data}->{TicketID},
            UserID      => 1,
            ArticleType => \@TypeOfArticleConfig,
         );
         
         # get the number of Articles will be migrated from sysconfig
         my $ArticleNumbers = 0;
         if ($ChildTicket{StateType} eq 'closed') {            
            $ArticleNumbers = $Self->{ConfigObject}->Get("Ticket::NumberRecentArticleOnCloseChild");
         }
         else {
            $ArticleNumbers = $Self->{ConfigObject}->Get("Ticket::NumberRecentArticleOnPendingChild");
         }
         
         # get number of recent articles in config
         my @RecentArticles;
         foreach (reverse @Articles) {
            push(@RecentArticles, $_);                           
            $ArticleNumbers--;
            last if $ArticleNumbers<=0;
         }
            
         # get mapping states of parent and child ticket from sysconfig
         my %MappingState = %{ $Self->{ConfigObject}->Get("Ticket::ChildParentStateMapping") };
         # get state will be update for parent
         my $StateParent;
         if ($ChildTicket{State}) {
            $StateParent = $MappingState{$ChildTicket{State}};
         }
         
         # performed by OTRS Event
         #my %User = $Self->{UserObject}->GetUserData(UserID => $EventUserID,);
            # performed by current user
            my %User = $Self->{UserObject}->GetUserData(UserID => $Param{UserID},);
         my $From = "$User{UserFirstname} $User{UserLastname} <$User{UserEmail}>";
         
         # migrate foreach parent ticket
         for my $ParentTicketID ( keys %LinkList ) {
            # need to check parent ticket is not master ticket only, a slave is still accepted
            my %ParentTicket = $Self->{TicketObject}->TicketGet(
               TicketID => $ParentTicketID,
               DynamicFields => 1,
               UserID   => 1,
            );            
            next if (($ParentTicket{DynamicField_MasterSlave}) and ($ParentTicket{DynamicField_MasterSlave}) !~ m/^Slave.*/);
            
            # push articles of child to parents
            for my $Article (reverse @RecentArticles) {
               # create article for parent ticket
               my $ArticleID = $Self->{TicketObject}->ArticleCreate(
                  TicketID         => $ParentTicketID,
                  ArticleType      => $Article->{ArticleType},                        # email-external|email-internal|phone|fax|...
                  SenderType       => $Article->{SenderType},                                # agent|system|customer
                  From             => $From,       # not required but useful
                  To               => $Article->{To}, # not required but useful
                  Cc               => $Article->{Cc}, # not required but useful
                  ReplyTo          => $Article->{ReplyTo}, # not required
                  Subject          => $Article->{Subject}." [Task#".$ChildTicket{TicketNumber}."]",               # required
                  Body             => $Article->{Body},                     # required
                  MessageID        => $Article->{MessageID},          # not required but useful
                  InReplyTo        => $Article->{InReplyTo},           # not required but useful
                  References       => $Article->{References}, # not required but useful
                  ContentType      => $Article->{ContentType},      # or optional Charset & MimeType
                  HistoryType      => 'OwnerUpdate',                        # EmailCustomer|Move|AddNote|PriorityUpdate|WebRequestCustomer|...
                  HistoryComment   => 'Article from child ticket',
                        UserID           => $Param{UserID},
                  NoAgentNotify    => $Article->{NoAgentNotify},                                      # if you don't want to send agent notifications
                  AutoResponseType => $Article->{AutoResponseType},                          # auto reject|auto follow up|auto reply/new ticket|auto remove
                  ForceNotificationToUserID   => $Article->{ForceNotificationToUserID},               # if you want to force somebody
                  ExcludeNotificationToUserID => $Article->{ExcludeNotificationToUserID},                   # if you want full exclude somebody from notfications,
                                                               # will also be removed in To: line of article,
                                                               # higher prio as ForceNotificationToUserID
                  ExcludeMuteNotificationToUserID => $Article->{ExcludeMuteNotificationToUserID},               # the same as ExcludeNotificationToUserID but only the
                                                               # sending gets muted, agent will still shown in To:
                                                               # line of article
               );               
            }
            
            # update state for parent ticket
            if ($StateParent) {               
               $Self->{TicketObject}->TicketStateSet(
                  TicketID => $ParentTicketID,
                  State  => $StateParent,
                        UserID    => $Param{UserID},
               );
            }
         }
      }
    }

    return 1;
}

1;
In the SysConfig, I am able to select the new Event Module and see my config out of the XML file. All seems to look good from scratch, but still...

I see alot of Error entries in the SysLog:

[...]
Thu Oct 8 14:24:55 2015 error OTRS-CGI-25 Need module!
[...]

In the end, no update is made to the parent. Is it maybe due to the fact that the UpdateToParent module is using objects that are not standard?
Like NumberRecentArticleOnCloseChildor other?
Is it even necessary to create the mentioned XML file? I read in the OTRS manual about custom Events that it may not be needed.

All in all im pretty newbie to the pearl modules.
Any reply, and if it is just a more informative logfile would be highly appreciated.

Thanks
Last edited by Tadur on 08 Oct 2015, 15:27, edited 1 time in total.
OTRS Version 4.0.11
on CentOS
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Also create an article to parent ticket

Post by crythias »

The proper way to do this is to create a TicketEvent that reacts to the appropriate changes that you'd want to update the parent: seek the parent, apply the values.

The caveats:
1) This could trigger loops (possibly) if the parent has a parent that has a parent of the child.
2) Competing siblings could introduce a race condition updating the same field.
3) The Master Slave module is intended to do the reverse... push down values from the Master to the Slave tickets.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Tadur
Znuny newbie
Posts: 6
Joined: 05 Oct 2015, 14:48
Znuny Version: 4.0.11

Re: Also create an article to parent ticket

Post by Tadur »

Thank you for that fast reply and your thoughts!

The Tutorial you created there is very impressive. I wish I would have known this before - still im glad to see that I understood the basics beforehand. I were able to find a maybe critical issue in my .xml file (has been updated above already).

Now it looks like the event is triggered properly, but still many further issues are applying / preventing:

Thu Oct 8 16:09:08 2015 error OTRS-CGI-25 Module Kernel/System/Ticket/Event/UpdateToParent.pm not in @INC (/opt/otrs/KIX4OTRSGeneralCatalog /opt/otrs/KIX4OTRSITSMChangeManagement /opt/otrs/KIX4OTRSITSMIncidentProblem /opt/otrs/KIX4OTRSITSMConfigManagement /opt/otrs/KIX4OTRSITSMCore /opt/otrs/KIX4OTRS /opt/otrs/KIXCore /usr/Custom /usr/Kernel/cpan-lib /usr /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd)

I know, I know... "contact KIX vendor" you want to say now. But some of these issues are requesting cpan libraries if im not wrong.
Im not sure if I will be able to workaround these KIX issues. Thank got I did a database and file backup before I installed it.
OTRS Version 4.0.11
on CentOS
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Also create an article to parent ticket

Post by crythias »

Tadur wrote:Kernel/System/Ticket/Event/UpdateToParent.pm
probably
/opt/otrs/Kernel/System/Ticket/Event/UpdateToParent.pm (?)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Also create an article to parent ticket

Post by RStraub »

You could check two things. Is your module named correctly (to the path) ?
So does it have:

Code: Select all

package Kernel::System::Ticket::Event::UpdateToParent;
at the top of the file?

Secondly, did you register it via a .xml file? You should have a file in ~otrs/Kernel/Config/Files/xxx.xml that reads something like:

Code: Select all

    </ConfigItem>
        <ConfigItem Name="Ticket::EventModulePost###950-UpdateToParent" Required="0" Valid="1">
        <Description Translatable="1">Event module registration. For more performance you can define a trigger event (e. g. Event => TicketCreate).</Description>
        <Group>Ticket</Group>
        <SubGroup>Core::Ticket</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::System::Ticket::Event::UpdateToParent</Item>
                <Item Key="Event">TicketSLAUpdate|TicketQueueUpdate|TicketStateUpdate|ArticleCreate</Item>
            </Hash>
        </Setting>
    </ConfigItem>
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Tadur
Znuny newbie
Posts: 6
Joined: 05 Oct 2015, 14:48
Znuny Version: 4.0.11

Re: Also create an article to parent ticket

Post by Tadur »

Thanks for your support guys.

This done the trick:
crythias wrote:
Tadur wrote:Kernel/System/Ticket/Event/UpdateToParent.pm
probably
/opt/otrs/Kernel/System/Ticket/Event/UpdateToParent.pm (?)
I had it located in

/Kernel/Modules/UpdateToParent.pm
and
Custom/Kernel/Modules/UpdateToParent.pm

Looks like I made some mistakes interpreting the documentation about the (Custom) Kernel area.
So finally I reached the point that Misfitz did 1 1/2 year ago:

I get the same "internal Server error" [Code500] like he did.
As I am able to reproduce his issue, it looks like that the advertised module is just not working without further deployment.
I tried to debug it via running it directly with perl -d command but nothing useful is shown.

Unfortunately your Module, Mr ndhvu275, isnt working (anymore, or in general).
Due to the complexity of OTRS and the function itself I may need to buy someones expertise.

Edit: Did some further digging through the module and found possible weakspots. SysConfig Modules like Ticket::ArticleTypeOnChild or Ticket::NumberRecentArticleOnCloseChild cannot be located in my OTRS 3.3 (old) and OTRS 4.0.11 (new + KIX). I guess when the module is trying to fetch data from it, it will fail and probably get us these errors we see.
I dont know where the creator found these SysConfigs, but I guess they are modified or changed during the years.

Edit2: Reading again through the Post of the creator above he is mentioning changes he made in the SysLog to fit his solution. But how can one use his solutions without these changes? I would need to reverse engineer it...
OTRS Version 4.0.11
on CentOS
Locked