[Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Moderator: crythias

Locked
zbigniew
Znuny newbie
Posts: 53
Joined: 11 Dec 2014, 13:30
Znuny Version: 5.0.23
Real Name: Zbigniew Luszpinski

[Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by zbigniew »

OTRS ITSM 4.0.5
/otrs/index.pl?Action=AgentTicketPhone
When create new Phone ticket it fails with system error:Need TicketID!
In logs see:
Fri Feb 20 19:25:32 2015 error OTRS-CGI-20 Need TicketID!
Fri Feb 20 19:25:32 2015 error OTRS-CGI-20 Need ObjectID!
Fri Feb 20 19:25:32 2015 error OTRS-CGI-20 Need ObjectID!
Fri Feb 20 19:25:32 2015 error OTRS-CGI-20 Need ObjectID!
Fri Feb 20 19:25:32 2015 error OTRS-CGI-20 No PriorityID (invalid Priority Name?)!

There is 300GB free space on disk, only few test tickets inside. Tried to fix by doing:
otrs.SetPermissions.pl, otrs.CheckModules.pl, otrs.CheckDB.pl, otrs.RebuildConfig.pl, otrs.DeleteCache.pl, apache and otrs restart. Package manager says all otrs files are genuine and unmodifed so everything clean in files.

Recently I was hiding some fields and modified priority and statuses names in AgentTicketPhone. This may be a source of problem.

AgentTicketEmail works perfect so the problem lies in difference between AgentTicketPhone and AgentTicketEmail.
Last edited by zbigniew on 21 Feb 2015, 17:53, edited 2 times in total.
zbigniew
Znuny newbie
Posts: 53
Joined: 11 Dec 2014, 13:30
Znuny Version: 5.0.23
Real Name: Zbigniew Luszpinski

Re: Can not create ticket: Need TicketID! Need ObjectID!

Post by zbigniew »

Solution: remove parameter: Disabled => 1,
File: Kernel/Modules/AgentTicketPhone.pm line 2679 in section:
$Param{PriorityStrg} = $Self->{LayoutObject}->BuildSelection(
Data => $Param{Priorities},
Name => 'PriorityID',
SelectedID => $Param{PriorityID},
SelectedValue => $Param{Priority},
Translation => 1,
Disabled => 1,
);

I have added Disabled => 1, to make Priority field read only by user so user can see calculated priority but not change it. Looks great on form but blocks saving it. Does anyone know how to make Priority field read-only without breaking new ticket creation?
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: [Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by eandrex »

A way should be hidding it.

To do so, just edit your .tt files

https://github.com/OTRS/otrs/blob/rel-4 ... on.tt#L257

should be

Code: Select all

<div class="Field" style="display:none;">
and maybe hide that label too?
zbigniew
Znuny newbie
Posts: 53
Joined: 11 Dec 2014, 13:30
Znuny Version: 5.0.23
Real Name: Zbigniew Luszpinski

Re: [Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by zbigniew »

eandrex wrote:A way should be hidding it.
It have to be visible so user can see calculated priority but not modify it. If no better solution will come up I will use yours.
Disabled => 1, is great because does exactly what I need - combobox with Priority is visible but not user selectable. When user changes Impact value can see that Priority also changes value as calculation of Impact. The only drawback of this solution it breaks ticket save.
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: [Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by eandrex »

then try pasting this

Code: Select all

Core.App.Ready(function(){
	$("#NewPriorityID").prop("disabled", "disabled");
});
below this line:

https://github.com/OTRS/otrs/blob/rel-4 ... on.tt#L265

in theory, it should be same result as yours (Disabled => 1) but who knows, give it a try!
zbigniew
Znuny newbie
Posts: 53
Joined: 11 Dec 2014, 13:30
Znuny Version: 5.0.23
Real Name: Zbigniew Luszpinski

Re: [Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by zbigniew »

eandrex wrote:then try pasting this in theory, it should be same result as yours (Disabled => 1) but who knows, give it a try!
Thanks but does not work - makes no difference in form outlook - Priority still selectable by user.
How about changing combobox to text which will just display calculated priority? This would be the best.
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: [Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by eandrex »

My apologies,

i just read again your post and i see it should disable the priority thing when creating a new ticket phone

Open AgentTicketPhone.tt

Scroll down to this line(around line ~594 if you have ITSM)

Code: Select all

Core.Config.Set('Localization.Delete', [% Translate("Delete") | JSON %]);
below that line, paste this

Code: Select all

Core.App.Ready(function(){
	$("#PriorityID").prop("disabled", true);
});
something similar should apply for AgentTicketEmail.tt
zbigniew
Znuny newbie
Posts: 53
Joined: 11 Dec 2014, 13:30
Znuny Version: 5.0.23
Real Name: Zbigniew Luszpinski

Re: [Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by zbigniew »

Thanks for help - this code works but effect is exactly the same as Disabled => 1 - can not create ticket after filing form - fails with: Need TicketID! error. So it looks nothing can be done thanks for not giving up and for help.
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: [Partially Solved]Can not create ticket: Need TicketID! Need ObjectID!

Post by eandrex »

zbigniew wrote:Thanks for help - this code works but effect is exactly the same as Disabled => 1 - can not create ticket after filing form - fails with: Need TicketID! error. So it looks nothing can be done thanks for not giving up and for help.
mm, weird.. for me it works as expected.

Did you change "SystemID" after being in production?.

Time ago i had a problem when i could not create tickets(same error as yours). It turned out to be that i had changed the "SystemID", so i all had to do, was disable "Ticket::NumberGenerator::CheckSystemID"..

if it is not your case, ill give you a solution.

First step, implement this:
eandrex wrote:A way should be hidding it.

To do so, just edit your .tt files

https://github.com/OTRS/otrs/blob/rel-4 ... on.tt#L257

should be

Code: Select all

<div class="Field" style="display:none;">
Step two:

before this

Code: Select all

<div class="Field" style="display:none;">
paste this

Code: Select all

<div class="Field"><input type="text" disabled="disabled" id="CustomTicketPriority"></div>
step three:

below this line

Code: Select all

Core.Config.Set('Localization.Delete', [% Translate("Delete") | JSON %]);
paste this

Code: Select all

Core.App.Ready(function(){
	$("#PriorityID").bind("change", function(){
		$("#CustomTicketPriority").val($("#PriorityID option:selected").text());
	});
});


havent tested it, but it should work.
Locked