Customize your mantis

Here I am not going to talk about how to config the Issue life cycle. There are so many life cycle articles talking about it, and each company all have their standard.

Some article you may interested related mantis debug life cycle

http://www.warelab.org/blog/?p=24

http://www.suitable.com/docs/mantisbt.html

http://www.scribd.com/doc/2088848/Mantis-Administration-Guide

Here I want to talk about how to achieve this, in other words how to configure the display (the strings) in each selection.

Like in article http://www.suitable.com/docs/mantisbt.html, it talked about

Severity

An issue property, answering the question “when the problem occurs, how bad are the effects?” Specified by the reporter that created the issue, but may be changed later. Possible values are:

  • Feature: issue does not describe a problem
  • Typo: text is incorrect
  • Trivial: extremely minor issue
  • Minor: not trivial, but there is a workaround
  • Major: there is no workaround
  • Crash: product crashes
  • Block: prevents operating or testing part of system

[Note that I removed the default Mantis severity “Tweak”, since it seemed too close to “Trivial”. I also renamed “Text” to “Typo”, since the latter seems clearer.]

Reproducibility

An issue property, giving how often the issue has been seen when trying to reproduce it. Specified by the reporter that created the issue, but may be changed later. Possible values are:

  • always
  • sometimes
  • rarely
  • not seen again
  • have not tried
  • N/A

[Note that the default Mantis strings are always, sometimes, random, have not tried, unable to reproduce, N/A. I’ve regularized them so that they all could fit into the same statement about reproducibility.]

How to make it? Although, mantis offer various customized related working flow and role and others in the web view, there are no straight configuration in Mantis web pages to achieve it.

Mantis have default setting of those strings, and default config setting:

config_filter_defaults_inc.php   (contain global strings)

/core/constant_inc.php            (contain constant define)

/lang/*.txt  (for English language is strings_english.txt)

The most beautiful thing is you do not have to modify these default setting, what you have to do is to use custom setting file to overwrite them.

Here is the solution,

Create two files under mantis root folder:

custom_constant_inc.php

custom_strings_inc.php

And in custom_constant_inc.php file write the code below, you do not have to define the constant system already have.

<?php
# severity
define( 'TYPO', 15 );

# reproducibility
define( 'REPRODUCIBILITY_RARLY', 35 );
define( 'REPRODUCIBILITY_NOTSEEN', 40);

In custom_strings_inc.php write those:

<?php
# Note that we don’t have to remove the Updater entry from the
if ( lang_get_current() === 'english') {
$s_severity_enum_string ='10:feature,15:typo,20:trivial,50:minor,60:major,70:crash,80:block';
$s_reproducibility_enum_string = '10:always,30:sometimes,35:rarely,40:not seen again,70:have not tried,100:N/A';}

And in config_inc.php

# Customize severity and default when reporting a new bug
$g_severity_enum_string = '10:feature,15:typo,20:trivial,50:minor,60:major,70:crash,80:block';
$g_default_bug_severity = 10;

# Customize priority and default when reporting a new bug
$g_reproducibility_enum_string = '10:always,30:sometimes,35:rarely,40:not seen again,70:have not tried,100:N/A';
$g_default_bug_reproducibility = 10;

All right, now log in your mantis, have a look at what we got:)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s