RT::Ex...tTicket(3pm)
π RT::Ex...tTicket(3pm) π
User Contributed Perl Documentation β¨ this is the page for RT::Extension::RepeatTicket, bestie, and it's a long one so it comes in two parts β this is part 1, don't go anywhere π«Ά
π NAME π
RT::Extension::RepeatTicket β repeat tickets based on schedule π
β¨ DESCRIPTION β¨
So the RepeatTicket extension lets you set up recurring tickets, meaning brand new tickets get auto-created on a schedule. those new tickets come pre-loaded with the subject and the initial content of the original ticket in the recurrence. chef's kiss, honestly π
Once you activate the plugin by adding it to your RT_SiteConfig.pm file, every single ticket gets a Recurrence tab on both the create page and the edit pages. to set up a repeating ticket you just click the checkbox to "Enable Recurrence" and fill out the schedule for the new tickets. that's the whole vibe check π¦
New tickets get created in three situations: when you initially save the recurrence (if new tickets are needed), and whenever your daily cron job runs the rt-repeat-ticket script. lowkey elegant.
π RT VERSION π
Works with RT 5.0. If you're still on RT 4, go check out the 1.* versions instead. no judgment, we've all been there π
π§ INSTALLATION π§
okay so, step by step, here's how we install this thing:
perl Makefile.PLmakemake installβ may need root permissions πmake initdbβ only run this the first time you install this module.- If you run this twice, you may end up with duplicate data in your database π so like, don't.
- If you are upgrading this module, check for upgrading instructions in case changes need to be made to your database.
patch RTβ apply for 5.0.0:
patch -p1 -d /opt/rt5 < patches/0001-Fix-radio-checkbox-inputs-for-click-panel-behavior-o.patch
- Edit your
/opt/rt5/etc/RT_SiteConfig.pmβ add this line:
Plugin('RT::Extension::RepeatTicket');
- Clear your mason cache
rm -rf /opt/rt5/var/mason_data/obj
- Add
bin/rt-repeat-ticketto the daily cron job. β° - Restart your webserver. π
π MODES π
Simple Mode VS Concurrent Tickets Mode
This extension supports two different modes for repeat ticket configurations. the extension originally only supported Concurrent Tickets Mode but so many users found that logic counter intuitive, so now we have options. it's giving growth π±
Any existing repeat ticket configurations from previous versions will be in Concurrent Tickets Mode unless the definition is changed. no auto-migration bestie, sorry π«
The default for new repeat ticket configurations is Simple Mode. slay.
Simple Mode
In this mode, tickets are created and start on the recurring date. if the lead time field is filled out, the ticket will be due that many days after the recurring date. there is no check for existing active tickets, and if the rt-repeat-ticket script is run multiple times for the same day it will create a new ticket for each run. so yeah, careful with that one π
Concurrent Tickets Mode
In this mode, tickets are created with the due date as the recurring date. the tickets start on the due date minus the lead time. you can specify the max number of concurrent active tickets. and if the rt-repeat-ticket script is run multiple times for the same day, it will only create new tickets if there are fewer active tickets than the max number of concurrent active tickets. it's basically a bouncer at the club door π
π CONFIGURATION π
$RepeatTicketCoexistentNumber
Only used in Concurrent Tickets Mode.
$RepeatTicketCoexistentNumber determines how many tickets can be in an active status for a recurrence at any time. a value of 1 means one ticket at a time can be active. new tickets will not be created until the current active ticket is resolved or set to some other inactive status. you can also set this value per recurrence, overriding this config value. the extension default is 1 ticket.
$RepeatTicketLeadTime
When in Simple Mode, $RepeatTicketLeadTime is the number of days to add to the recurring date for the Due date of the ticket.
When in Concurrent Tickets Mode, $RepeatTicketLeadTime becomes the ticket Starts value and sets how far in advance of a ticket's Due date you want the ticket to be created. essentially this is how long you want to give people to actually work on the ticket. π°οΈ
For example, if you create a weekly recurrence scheduled on Mondays and set the lead time to 7 days, each Monday a ticket will be created with the Starts date set to that Monday and a Due date of the following Monday. β¨
When in Concurrent Tickets Mode, with a number of concurrent active tickets greater than 1, if you set the lead time to be larger than the interval between recurring tickets it can result in strange behavior. It is recommended that the ticket lead time be smaller or equal to the interval between tickets. β οΈ
The value you set in RT_SiteConfig.pm becomes the system default, but you can set this value on each ticket as well. the extension default is 14 days.
$RepeatTicketSubjectFormat
By default, repeated tickets will have the same subject as the original ticket. you can modify this subject by setting a format with the $RepeatTicketSubjectFormat option. this option accepts formats in the same form as formats for RT searches. the placeholders take values from the repeated ticket, not the original ticket, so you can use the format to help differentiate the subjects in repeated tickets. cute π
For example, if you wanted to put the due date in the subject, you could set the format to:
Set($RepeatTicketSubjectFormat, '__Due__ __Subject__');
You'll want to use values that you don't expect to change, since the subject won't change if the ticket value (e.g., Due) is changed.
Since this uses RT formats, you can create a custom format by creating a new RT ColumnMap. you can see the available formats by looking at the columns available in the Display Columns portlet on the RT ticket search page. iykyk π
$RepeatTicketPreviewNumber
By default, the Recurrence Preview will show the next 5 tickets that will be created. you can modify the number of tickets to show by setting the $RepeatTicketPreviewNumber option:
Set($RepeatTicketPreviewNumber, 10);
Set the $RepeatTicketPreviewNumber option to 0 to hide the Recurrence Preview. π
@RepeatTicketSkipCustomFields
By default, all custom field values are carried over to the new ticket. use this config option to skip some custom fields from being copied to the new ticket:
Set(@RepeatTicketSkipCustomFields, ('My Custom Field', 'Another Custom Field'));
rt-repeat-ticket
The rt-repeat-ticket utility evaluates all of your repeating tickets and creates any new tickets that are needed. with no parameters, it runs for "today" each day. you can also pass a --date value in the form YYYY-MM-DD to run the script for a specific day.
bin/rt-repeat-ticket --date 2012-07-25
This can be handy if your cron job doesn't run for some reason and you want to make sure no repeating tickets have been missed. just go back and run the script for the days you missed. you can also pass dates in the future, which might be handy if you want to experiment with recurrences in a test environment. π§ͺ
WARNING If you run the script multiple times for the same day then it is possible multiple tickets will be created for the same repeat ticket configuration. π
πΈ USAGE πΈ
Initial Tickets
The initial ticket you create for a recurrence stores the schedule and other details for the recurrence. if you need to change the recurrence in the future β make it more frequent, less frequent, literally anything else β make the changes on the original ticket. to help you find this initial ticket, which may have been resolved long ago, a custom field is created on each ticket in the recurrence with a link called "Original Ticket." π―
When setting up the recurrence, you can use the original ticket as an actual work ticket. when doing this, you'll need to set the Starts and Due dates when you create the ticket. scheduled tickets created subsequently will set these values based on the recurrence. and just so you know: resolving the original ticket does not cancel the recurrence. it keeps going, main character energy π
Start Value
You can set a Start date for a new recurrence. if you don't, it defaults to the day you create the recurrence. easy.
Cancelling Recurrences
You can cancel or end a recurrence in two ways:
- Go to the original ticket in the recurrence and uncheck the Enable Recurrence checkbox.
- Set ending conditions on the recurrence with either a set number of recurrences or an end date.
Recursive Recurrences
Creating recurrences on recurrences isn't supported and may do strange things. π bestie, just don't.
π FAQ π
I'm not seeing new recurrences. Why not?
A few things to check, bestie:
- Do you have
rt-repeat-ticketsscheduled in cron? Is it running? β° - If the repeat configuration is in Concurrent Tickets Mode, do you have previous tickets still in an active state? resolve those tickets or increase the concurrent active tickets value.
- Is it the right day? if the repeat configuration is in Concurrent Tickets Mode, remember to subtract the lead time value to determine the day new tickets should be created.
- If you set a start date and another criteria like day of the week, the new ticket will be created on the first time that day of the week occurs after the start date you set (if the start date isn't on that day of the week).
I want to enable the repeat function only on some queues
To do this, instead of applying the "Original Ticket" custom field globally, you can apply it to the chosen queues and that's it. periodt. β¨
some users can't see or use this feature successfully.
Make sure those users have SeeCustomField and ModifyCusotmField rights granted for the "Original Ticket" custom field. π
π SEARCHING π
To search for tickets that have recurrence enabled, use the following in a Ticket Search:
HasAttribute = 'RepeatTicketSettings'
This will need to be added on the Advanced tab β so build the rest of your search as desired and then add the clause on the Advanced tab. π
π METHODS π
Run( RT::Attribute $attr, DateTime $checkday )
Repeat the ticket if $checkday meets the repeat settings. it also tries to repeat more to meet config "RepeatTicketCoexistentNumber".
Return ids of new created tickets.
Repeat ( RT::Attribute $attr, DateTime $checkday_1, DateTime $checkday_2, ... )
Repeat the ticket for the check days that meet repeat settings.
Return ids of new created tickets.
MaybeRepeatMore ( RT::Attribute $attr )
Try to repeat more tickets to meet the coexistent ticket number.
Return ids of new created tickets.
SetRepeatAttribute ( RT::Ticket $ticket, %args )
Save %args to the ticket's "RepeatTicketSettings" attribute.
Return ( RT::Attribute, UPDATE MESSAGE ).
π«Ά AUTHOR π«Ά
Best Practical Solutions, LLC <modules@bestpractical.com>
π BUGS π
All bugs should be reported via email to
bug-RT-Extension-RepeatTicket@rt.cpan.org
or via the web at
http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-RepeatTicket
okay that's part 1 done, bestie β keep scrolling, part 2 is coming π
π LICENSE AND COPYRIGHT π
okay bestie, legal bit incoming, but it's short and it's actually kinda sweet π₯Ή
This software is Copyright (c) 2014-2020 by Best Practical Solutions β¨
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
fr fr, that's the whole license section β GPL v2, June 1991, no cap. if you're out here shipping this in your own thing, go read the actual license text, i'm just the messenger π
and that's a wrap on the whole page, bestie!! π the vibes were immaculate, the docs were documented, we ate and left no crumbs π
this one was rendered from the perl v5.40.1 toolchain, dated 2025-03-16, and it's the <yellow>RT::Ex...tTicket(3pm)</yellow> page from the User Contributed Perl Documentation collection π¦
go forth and search some tickets, you gorgeous nerd ππΈβ¨
π¦ where this page comes from
- debian trixie: rt5-extension-repeatticket 2.04-1 Β· GPL-2.0-only
- ubuntu resolute: rt5-extension-repeatticket 2.04-1 Β· GPL-2.0-only
- ubuntu stonking: rt5-extension-repeatticket 2.04-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms