From 4f49b16079b27d7ce633619e4cddfdf2bffbc952 Mon Sep 17 00:00:00 2001 From: cashmere Date: Fri, 4 Sep 2026 09:05:24 +0200 Subject: initial commit --- www/custom_ticket.wiki | 153 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 www/custom_ticket.wiki (limited to 'www/custom_ticket.wiki') diff --git a/www/custom_ticket.wiki b/www/custom_ticket.wiki new file mode 100644 index 0000000..eac0532 --- /dev/null +++ b/www/custom_ticket.wiki @@ -0,0 +1,153 @@ +Customizing The Ticket System + +

Introduction

+ +This guide will explain how to add the "assigned_to" and "submitted_by" fields +to the ticket system in Fossil, as well as making the system more useful. You +must have "admin" access to the repository to implement these instructions. + +

First modify the TICKET table

+ +Click on the "Admin" menu, then "Tickets", then "Table". After the other fields +and before the final ")", insert: +
+  ,
+  assigned_to TEXT,
+  opened_by TEXT
+
+ +And "Apply Changes". You have just added two more fields to the ticket +database! NOTE: I won't tell you to "Apply Changes" after each step from here +on out. Now, how do you use these fields? + +

Next add assignees

+ +Back to the "Tickets" admin page, and click "Common". Add something like this: +
+set assigned_choices {
+  unassigned
+  tom
+  dick
+  harriet
+}
+
+ +Obviously, choose names corresponding to the logins on your system. The +'unassigned' entry is important, as it prevents you from having a NULL in that +field (which causes problems later when editing). + +

Now modify the 'new ticket' page

+ +Back to the "Tickets" admin page, and click "New Ticket Page". This is a little +more tricky. Edit the top part: + + +if {[info exists submit]} { + set status Open + set opened_by $login + set assigned_to "unassigned" + submit_ticket +} + + +Note the "set opened_by" bit -- that will automatically set the "opened_by" +field to the login name of the bug reporter. Now, skip to the part with "EMail" +and modify it like so: + + +enable_output expr { "$login" eq "anonymous"} + + + EMail: + + + + Not publicly visible. Used by developers to contact you with questions. + + +enable_output 1 + + +This bit of code will get rid of the "email" field entry for logged-in users. +Since we know the user's information, we don't have to ask for it. NOTE: it +might be good to automatically scoop up the user's email and put it here. + +You might also want to enable people to actually assign the ticket to a specific +person during creation. For this to work, you need to add the code +for "assigned_to" as shown below under the heading "Modify the 'edit ticket' page". +This will give you an additional combobox where you can choose a person during +ticket creation. + +

Modify the 'view ticket' page

+ +Look for the text "Contact:" (about halfway through). Then insert these lines +after the closing tr tag and before the "enable_output" line: + + + + Assigned to: + $ + + Opened by: + $ + + + + +This will add a row which displays these two fields, in the event the user has +ticket "edit" capability. + +

Modify the 'edit ticket' page

+ +Before the "Severity:" line, add this: + + + + Assigned to: + + combobox assigned_to $assigned_choices 1 + + + + +That will give you a drop-down list of assignees. The first argument to the TH1 +command 'combobox' is the database field which the combobox is associated to. +The next argument is the list of choices you want to show in the combobox (and +that you specified in the second step above.) The last argument should be 1 for +a true combobox (see the TH1 documentation for +details). + +Now, similar to the previous +section, look for "Contact:" and add this: + + + + Reported by: + + + + + + +

What next?

+ +Now you can add custom reports which select based on the person to whom the +ticket is assigned. For example, an "Assigned to me" report could be: + + +SELECT + CASE WHEN status IN ('Open','Verified') THEN '#f2dcdc' + WHEN status='Review' THEN '#e8e8e8' + WHEN status='Fixed' THEN '#cfe8bd' + WHEN status='Tested' THEN '#bde5d6' + WHEN status='Deferred' THEN '#cacae5' + ELSE '#c8c8c8' END AS 'bgcolor', + substr(tkt_uuid,1,10) AS '#', + datetime(tkt_mtime) AS 'mtime', + type, + status, + subsystem, + title +FROM ticket +WHERE assigned_to=user() + -- cgit v1.3.1