Extension:Mantis

The Mantis extension allows users to display a list of MantisBT tickets on a page.

By default it shows a color-coded table of open tickets. The following options can be customized:


 * table header on/off
 * colors on/off
 * length of summary text
 * date format
 * specify tickets by bugid
 * display tickets by status
 * sort by a column (ascending and descending)
 * show only certain columns
 * limit the output
 * suppress error and informational messages
 * add comments to tickets

Installation

 * Grab the code via git:
 * Add the following code at the bottom of your LocalSettings.php:
 * ✅ – Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Configuration
By default the following options are set by this extension:

You may change each one of these parameters by including it with your specified value into your  below the initialization of this extension.

Set  to the root of the Mantis web page, e.g.  . If you don't set it or leave it empty, the Id field will not have a link to the Mantis ticket.

If you have customized or added additional fields to your MantisBT environment, you should change the last 4 parameters accordingly. The correct strings can be found in the file   in your Mantis directory.

Usage
This extension can be used with XML-like syntax in the wiki edit view. The parameters control what data and how it will be displayed. See the following sections for information on each parameter. By default it will show a color-coded table of open tickets.



To display the last 3 'assigned' tickets without header and colorized rows with columns Id, Status, Updated, and Summary:

status = assigned header = false color = false count = 3 show  = id, status, updated, summary



Parameters
Parameters are set in the format. Whitespaces are ignored.

bugid
bugid specifies a single ticket or a list of tickets (separated by comma). If only a single ticket is specified, header and color are turned off automatically. They can be turned on again, by setting them explicitly. If the ticket is (or the tickets are) not found, an informational message is displayed unless  suppressinfo is set to true.

color
color decides, if the table will be color-coded. The default value is true unless a single  bugid is specified. The parameter can be set to true and false, whereas on and yes are aliases for true, and off and no are aliases for false. If the input value is not recognized, it will be ignored and the default value will be used.

status
status determines which tickets will be shown in the table. The default value is open, which are all tickets that are not closed. In a standard Mantis environment, the following values are valid new, feedback, acknowledged, confirmed, assigned, resolved, and closed. If the input value is not recognized, it will be ignored and the default value will be used.

If you have a customized, the status names listed in the parameter are valid values.

count
count restricts the number of results that are shown. There is no default value. If the input value is not recognized, it will be ignored.

orderby
orderby determines by which column the table is sorted. The default value is updated, which is the date the ticket was last updated. Valid values are id, category, severity, priority, status, username, created, updated, and summary. If the input value is not recognized, it will be ignored and the default value will be used. Instead of orderby, the aliases sortkey or ordermethod may be used.

order
order decides the sort direction. The value can be descending (default, most recent to oldest) or ascending (oldest to most recent). desc' is an alias for descending, and 'asc is an alias for ascending. If the input value is not recognized, it will be ignored and the default value will be used.

summarylength
summarylength specifies the length of the summary text to display. If set, the summary text is cut off at the specified length. There is no default value. If the input value is not recognized, it will be ignored.

suppressinfo
suppressinfo hides informational messages, e.g. that no ticket with a specified  bugid was found or that there are no tickets with a certain  status. The value can be true (hide informational messages) or false (default, show informational messages). on and yes are aliases for true, and off and no are aliases for false. If the input value is not recognized, it will be ignored and the default value will be used.

show
show specifies which columns are shown in the table. By default the following columns are shown: id, category, severity, status, updated, and summary. Valid values are id, category, severity, priority, status, username, created, updated, and summary. If the input value is not recognized, it will be ignored. Are all of the input values invalid, the default columns are shown.

comment
comment makes it possible to add comments to tickets. They are specified by using the following format:, where   can be any character. The following 3 expressions, which will add the comment to ticket number 42, are equivalent: comment.42 = Answer to the Ultimate Question of Life, The Universe, and Everything comment#42 = Answer to the Ultimate Question of Life, The Universe, and Everything comment/42 = Answer to the Ultimate Question of Life, The Universe, and Everything