Custom mandatory input fields , restrict attachment file extensions on ticket creation within one queue only

Hi all,

We are looking to create one queue that has unique restrictions compared to other queues that have none.

We want this new queue to have the following restrictions on the initial raising of the ticket only:

-Restrict user uploads to only certain file types
-Have mandatory fields (example name, department, project) that must be filled before the ticket can be raised.

Can anyone advise if this is possible in RT and if so, how to go about it?

Thank you in advance.

You can certainly specify that Custom Fields are mandatory, and you can also attach different sets of custom fields on a per queue basis. As an admin create your custom fields (manu Admin->Custom Fields->Create) putting in a the (?#Mandatory). validation for any mandatory ones. Then go to the queue you want to attach them to (menu Admin->Queues->Select and click on the queue name) and click on the “Custom Fields” tab, selecting the “Tickets” drop down. Select the custom field(s) you want attached to tickets in that queue and then press the Submit button.

If your initial ticket content is coming in from emails, you might want to check out the RT::Extension::ExtractCustomFieldValues module. I’ve not used that myself but I think one issue you might have is emails that don’t have patterns in them for the custom fields you want to make mandatory. You might need a separate scrip for those to reject the ticket.

As for restricting user uploads to only certain file types, I don’t think that functionality is built into the RT distribution, so you’ll probably either need to use a callback or have local overlay code that works out if the file type being uploaded matches your allowed list.

Hi there, thank you for such a detailed reply - that has been really helpful.
Thankfully tickets aren’t being raised by email, so that simplifies things.

In relation to the file type restriction - could one inject HTML/JS to any tickets created in
a defined queue, to limit file type seen when browsing for the attachment? If one could, how would
you go about it?

I have this working on a standard webpage, just need to encorporate it into RT - I’m very keen to avoid Perl, as I know nothing of it

Your help is greatly appreciated!

Thanks again.

I guess you could look for patterns in the HTML that RT generates from its Perl Mason templates and then use some Javascript to set the CSS display to none for attachments that have a file extension type you don’t have in a whitelist. The HTML in the ticket display Attachment list doesn’t include the full MIME type though, so if the files don’t have file extensions it won’t work. Seems a bit fragile to me.

Another option, if you’re not up for coding in Perl, is to contact Best Practical and see if they’d take on a contract job to provide such a feature for you.

Thank you - I think I’ll get stuck into the book and see if I can do it with CSS and Javascript - if it works, it would be good enough for our purposes - it’s not mission critical if a file gets through and all the files in question have file extensions.

Thanks for the suggestion about Best Practical - I’ll reach out to them and see what costs are like, if the costs are reasonable for this, it may be the best way forward.

Thank you for your input - you have been really helpful, it’s greatly appreciated.

Certainly! In RT (Request Tracker), you can create a new queue with unique restrictions for ticket creation. To achieve this, log in to your RT system with administrative privileges and navigate to the Queue configuration settings. Create a new queue and specify the desired settings, such as restricting user uploads to certain file types and making certain fields mandatory before ticket creation. You can customize these settings based on your requirements. Regards