Hi, I want to add a custom field to a ticket . I know that this can be done using FreeTextField.
But, it is for entering text values.
I want the custom field for entering a Date value. A DatePicker should be displayed next to it.
Also, in the Queue View, for e.g. "AgentTicketQueue", I want to add this custom field as a new column.
The user should be able to sort the ticket view based on this custom field value.
Pls let me know how can I do this things.
Adding a custom field in a ticket and displaying it in view
Moderator: crythias
-
- Znuny expert
- Posts: 250
- Joined: 12 Oct 2010, 01:35
- Znuny Version: 3.0.9
- Company: LRS Health
Re: Adding a custom field in a ticket and displaying it in v
It's called a 'TicketFreeTime' field. And can easily be selected/configured.
Sorting by TicketFreeTime in Queue View? Totally different matter, will need some funky coding.
Best bet would be to use the Ticket Search feature!
Sorting by TicketFreeTime in Queue View? Totally different matter, will need some funky coding.
Best bet would be to use the Ticket Search feature!
OTRS: 3.0.9 & ITSM 3.0.4 - OS: Windows 7 - DB: MySQL - Heaps of random/useful hacks 
[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText

[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText
-
- Znuny newbie
- Posts: 3
- Joined: 12 Jul 2011, 14:40
- Znuny Version: 3.0.8
- Real Name: Nishant Agarwal
Re: Adding a custom field in a ticket and displaying it in v
Thank you Michael for mentioning about 'TicketFreeTime' field.MichaelR wrote:It's called a 'TicketFreeTime' field. And can easily be selected/configured.
Did some code change to add the new column in Queue View.MichaelR wrote:Sorting by TicketFreeTime in Queue View? Totally different matter, will need some funky coding.
Best bet would be to use the Ticket Search feature!
Post at http://forums.otrs.org/viewtopic.php?f=60&t=5156 helped a lot.
I'll post the code changes that I have done to add the new column soon.
-
- Znuny newbie
- Posts: 3
- Joined: 12 Jul 2011, 14:40
- Znuny Version: 3.0.8
- Real Name: Nishant Agarwal
Re: Adding a custom field in a ticket and displaying it in v
For adding 'TicketFreeTime1' as a new column in 'AgentTicketQueue', I made changes in following two files:
1. /Kernel/Output/HTML/TicketOverviewSmall.pm
2. /Kernel/Output/HTML/Standard/AgentTicketOverviewSmall.dtl
In "TicketOverviewSmall.pm"
I modified the code
as
to get the data for new column.
In "AgentTicketOverviewSmall.dtl"
I added a new <th> and <td> element to display the new column
1. /Kernel/Output/HTML/TicketOverviewSmall.pm
2. /Kernel/Output/HTML/Standard/AgentTicketOverviewSmall.dtl
In "TicketOverviewSmall.pm"
I modified the code
Code: Select all
my @Col = (qw(TicketNumber Age State Lock Queue Owner CustomerID));
Code: Select all
my @Col = (qw(TicketNumber Age State Lock Queue Owner CustomerID TicketFreeTime1));
In "AgentTicketOverviewSmall.dtl"
I added a new <th> and <td> element to display the new column
Code: Select all
<!-- dtl:block:OverviewNavBarPageTicketFreeTime1 -->
<th class="$Config{"TicketFreeTimeKey1"} Last $QData{"CSS"}">
<a name="OverviewControl" href="$Env{"Baselink"}Action=$Env{"Action"};$Data{"LinkSort"};SortBy=TicketFreeTime1; OrderBy=$LQData{"OrderBy"}">$Text{"$Config{"TicketFreeTimeKey1"}"}</a>
</th>
<!-- dtl:block:OverviewNavBarPageTicketFreeTime1 -->
................
................
<td nowrap>
<div title="$QData{"TicketFreeTime1"}">$Date{"$QData{"TicketFreeTime1"}"}</div>
</td>
-
- Znuny newbie
- Posts: 27
- Joined: 05 Jul 2011, 14:57
- Znuny Version: 2.4.9
- Real Name: George Elisha
- Company: QLogy Management Services Pvt Ltd
Re: Adding a custom field in a ticket and displaying it in v
Appreciate if anyone give inputs on how to print values by "Change_time" in "Time1" Column??..
-
- Znuny newbie
- Posts: 27
- Joined: 05 Jul 2011, 14:57
- Znuny Version: 2.4.9
- Real Name: George Elisha
- Company: QLogy Management Services Pvt Ltd
Re: Adding a custom field in a ticket and displaying it in v
Hi I have made little changes to the above code
and in System/Ticket.pm TicketFreeTime1 => 'st.freetime1', is changed to
Code: Select all
<!-- dtl:block:OverviewNavBarPageTicketFreeTime1 -->
<th class="$$Config{"TicketFreeTimeKey1"} Last $QData{"CSS"}">
<a name="OverviewControl" href="$Env{"Baselink"}Action=$Env{"Action"};$Data{"LinkSort"};SortBy=TicketFreeTime1;OrderBy=$LQData{"OrderBy"}">$Text{"Last Update"}</a>
</th>
<!-- dtl:block:OverviewNavBarPageTicketFreeTime1 -->
............
<td nowrap>
<div title="$QData{"TicketFreeTime1"}">$QData{"Changed"}</div>
</td>
Code: Select all
TicketFreeTime1 => 'st.change_time',