[SOLVED]Get PriorityID for a particular Priority

Moderator: crythias

Locked
adt
Znuny newbie
Posts: 43
Joined: 28 Jun 2012, 17:04
Znuny Version: 2.4.9

[SOLVED]Get PriorityID for a particular Priority

Post by adt »

Is there any way to get a PriorityID corresponding to a Priority such that whatever Admin sets as PriorityDefault, it's corresponding ID should be saved to the database.
I'm trying to modify that in CustomerTicketMessage.pm file, but not getting any idea of it...

OTRS 2.4.9
Debian


Thanks !
Last edited by adt on 20 Aug 2012, 13:23, edited 1 time in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Get PriorityID for a particular Priority

Post by crythias »

http://dev.otrs.org/2.4/Kernel/System/Priority.html

Code: Select all

    my $PriorityID = $PriorityObject->PriorityLookup(
        Priority => '3 normal',
    );
http://dev.otrs.org
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
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Get PriorityID for a particular Priority

Post by crythias »

Why are you modifying CustomerTicket for this purpose?
adt wrote: whatever Admin sets as PriorityDefault, it's corresponding ID should be saved to the database
Do you want all tickets to have this priority by default? Change it in Sysconfig.
Do you want all tickets to have this priority and no other priority? Either hide priority in sysconfig or directly in the .dtl
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
adt
Znuny newbie
Posts: 43
Joined: 28 Jun 2012, 17:04
Znuny Version: 2.4.9

Re: Get PriorityID for a particular Priority

Post by adt »

Hi crythias,
the problem was with PriorityID.

In my Customer Interface Priority is not shown to customers to be filled, instead i'm using Default priority to be inserted.But if i select Default Priority to be 2 low or 5 very high or any priority; it was always getting stored as 3 normal and id was 3 in my DB.I wanted to get rid of this problem such that if Admin has set any priority, the PriorityID should be saved corresponding to this itself.

The line

Code: Select all

    $Self ->{PriorityObject} = Kernel::System::Priority->new(%Param); 
wasn't present in my code then after this
i am supposed to write the code to fetch the PriorityID, and i got that working by following code>>>

Code: Select all

   my $fetchprioid = $Self->{PriorityObject}->PriorityLookup(Priority => $Self->{Config}->{PriorityDefault});
and

Code: Select all

  PriorityID   => $fetchprioid,

while inserting it to DB. Thanks for your reply crythias.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [SOLVED]Get PriorityID for a particular Priority

Post by crythias »

If you know what you're trying to accomplish, why not put the other value as default instead of modifying code to translate it? You can get the value you seek by hovering over the link in the Priority list.
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
Locked