[SOLVED]Is that possible to shown child ticketin Report function ?
-
- Znuny newbie
- Posts: 12
- Joined: 22 Jan 2019, 10:32
- Znuny Version: ITSM 6
[SOLVED]Is that possible to shown child ticketin Report function ?
Dear all,
After splitting the ticket into different child tickets, is that possible to shown the relation of child ticket and parent ticket in the report that provided by otrs ? Thank you so much !
Best regards,
Frances Wong
After splitting the ticket into different child tickets, is that possible to shown the relation of child ticket and parent ticket in the report that provided by otrs ? Thank you so much !
Best regards,
Frances Wong
You do not have the required permissions to view the files attached to this post.
Last edited by franceswong0129 on 18 Feb 2019, 03:26, edited 1 time in total.
-
- Znuny newbie
- Posts: 12
- Joined: 22 Jan 2019, 10:32
- Znuny Version: ITSM 6
Re: Is that possible to shown child ticketin Report function ?
Dear all,
Or is that possible to make the linked-object shown as an attributes in the Stats DynamicList ?
Thank you once again!
Best regards,
Frances Wong
Or is that possible to make the linked-object shown as an attributes in the Stats DynamicList ?
Thank you once again!
Best regards,
Frances Wong
-
- Znuny superhero
- Posts: 635
- Joined: 24 Feb 2012, 03:58
- Znuny Version: LTS and Features
- Real Name: Mo Azfar
- Location: Kuala Lumpur, MY
- Contact:
Re: Is that possible to shown child ticketin Report function ?
Nope..as the dynamic list data is from TicketGet api which dont include linked ticket value..
unless u know the sql to get the linked item, you can build it by using Static stats instead
unless u know the sql to get the linked item, you can build it by using Static stats instead
My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This
Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This
Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
-
- Znuny newbie
- Posts: 12
- Joined: 22 Jan 2019, 10:32
- Znuny Version: ITSM 6
Re: Is that possible to shown child ticketin Report function ?
Dear skullz,
Thank you so much for your reply! Is there any example on the implementation of sql in Static stats ? Becoz I have tried to copy the example from http://doc.otrs.com/doc/manual/develope ... de-example but it fails.
Best regards,
Frances Wong
-
- Znuny superhero
- Posts: 635
- Joined: 24 Feb 2012, 03:58
- Znuny Version: LTS and Features
- Real Name: Mo Azfar
- Location: Kuala Lumpur, MY
- Contact:
Re: Is that possible to shown child ticketin Report function ?
Thats exactly how it supposed to be..
however under sub Run(), put you SQL instead of calling the Ticket API.
check the DB API for prepare statement and fetch
https://doc.otrs.com/doc/api/otrs/6.0/P ... ml#Prepare
https://doc.otrs.com/doc/api/otrs/6.0/P ... chrowArray
however under sub Run(), put you SQL instead of calling the Ticket API.
check the DB API for prepare statement and fetch
https://doc.otrs.com/doc/api/otrs/6.0/P ... ml#Prepare
https://doc.otrs.com/doc/api/otrs/6.0/P ... chrowArray
My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This
Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This
Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
-
- Znuny newbie
- Posts: 12
- Joined: 22 Jan 2019, 10:32
- Znuny Version: ITSM 6
Re: Is that possible to shown child ticketin Report function ?
Dear skullz,skullz wrote: ↑12 Feb 2019, 06:37 Thats exactly how it supposed to be..
however under sub Run(), put you SQL instead of calling the Ticket API.
check the DB API for prepare statement and fetch
https://doc.otrs.com/doc/api/otrs/6.0/P ... ml#Prepare
https://doc.otrs.com/doc/api/otrs/6.0/P ... chrowArray
I have checked the error.log for the error. It wrote Got no DBObject.
Code: Select all
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {%Param};
bless( $Self, $Type );
# check all needed objects
for my $Needed (
qw(DBObject ConfigObject LogObject #<- marked this line with error
TimeObject MainObject EncodeObject)
)
{
$Self->{$Needed} = $Param{$Needed} || die "Got no $Needed";
}
# create needed objects
$Self->{TypeObject} = Kernel::System::Type->new( %{$Self} );
$Self->{TicketObject} = Kernel::System::Ticket->new( %{$Self} );
$Self->{QueueObject} = Kernel::System::Queue->new( %{$Self} );
return $Self;
}
Best regards,
Frances Wong
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Is that possible to shown child ticketin Report function ?
Object handling has changed in OTRS4
Code: Select all
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {%Param};
bless( $Self, $Type );
return $Self;
}
sub Run {
my ($Self, %Param) = @_;
my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
...
}
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
-
- Znuny newbie
- Posts: 12
- Joined: 22 Jan 2019, 10:32
- Znuny Version: ITSM 6
Re: Is that possible to shown child ticketin Report function ?
Dear reneeb,reneeb wrote: ↑12 Feb 2019, 17:01 Object handling has changed in OTRS4Code: Select all
sub new { my ( $Type, %Param ) = @_; # allocate new hash for object my $Self = {%Param}; bless( $Self, $Type ); return $Self; } sub Run { my ($Self, %Param) = @_; my $DBObject = $Kernel::OM->Get('Kernel::System::DB'); ... }
Thank you so much for your helping.
Unluckily I encountered another problems-- empty excel file is exported based on the following code.
If a csv file is exported then error occurs with the line :Can't use string ("138") as as ARRAY ref while in use at /opt/otrs/Kernel/System/CSV.pm
Sometimes otrs cannot recognize the Stats pm that I have written-> I can't pick my.pm file in OTRS as the object type.
Code: Select all
sub Run {
my ($Self, %Param) = @_;
my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
# Check needed stuff.
for my $ParamName (qw(StartYear StartMonth StartDay EndYear EndMonth EndDay)) {
if ( !$Param{$ParamName} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "Need $ParamName!",
);
return;
}
}
# set report title
my $Title = 'Parent And Child Ticket Number';
# table headlines
my @HeadData = (
'Parent Ticket',
'Child Ticket',
);
my @Data;
my $ParentNumber;
my $ChildNumber;
my $SQL = "SELECT target_key FROM link_relation";
$DBObject->Prepare(SQL => $SQL, Limit => 15);
while ($DBObject->FetchrowArray()) {
push @Data, $Row[0];
}
return ( [$Title], [@HeadData], @Data );
}
Thank you so much !!!!!!
Best regards,
Frances Wong
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Is that possible to shown child ticketin Report function ?
Code: Select all
while ($DBObject->FetchrowArray()) {
push @Data, $Row[0];
}
Code: Select all
while (my @Row = $DBObject->FetchrowArray()) {
push @Data, [$Row[0]];
}
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
-
- Znuny newbie
- Posts: 12
- Joined: 22 Jan 2019, 10:32
- Znuny Version: ITSM 6
Re: Is that possible to shown child ticketin Report function ?
Dear reneeb and all others,reneeb wrote: ↑13 Feb 2019, 11:37should beCode: Select all
while ($DBObject->FetchrowArray()) { push @Data, $Row[0]; }
Code: Select all
while (my @Row = $DBObject->FetchrowArray()) { push @Data, [$Row[0]]; }
Thank you so much for your helping. It works!
Best regards,
Frances Wong