Page 1 of 1

How to show "Severity" of issue in changelog?

Posted: 02 Oct 2006, 06:46
by mishutka
Is there any way to show "Severity" of an issue in changelog page?

We want to get something like this:
- 040: [Interface][feature] Allow to user to re-enter registrtion key if old one has not been expired yet. (MiSHuTka)

Thank you in advance.

Solution

Posted: 02 Oct 2006, 08:03
by mishutka
This was solved by adding something like the following to custom_functions_inc.php

Code: Select all

function custom_function_override_changelog_print_issue( $p_issue_id )
{
    $t_bug = bug_get( $p_issue_id );
    echo '#', string_get_bug_view_link( $p_issue_id ), ' <b>[', get_enum_element( 'severity', $t_bug->severity ),
         '][', $t_bug->category, ']</b> ',
         string_attribute( $t_bug->summary );

    if ( $t_bug->handler_id != 0 )
    {
      echo ' (<b>', prepare_user_name( $t_bug->handler_id ), '</b>)';
    }

    echo '<br />';
	}
Thanks to Victor for pushing me in right way. :)

Even more customized output

Posted: 02 Oct 2006, 08:33
by mishutka
That is my final solution :)

Code: Select all

function custom_function_override_changelog_print_issue( $p_issue_id )
{
	$t_bug = bug_get( $p_issue_id );

	$sCategory = ' <b>[' . $t_bug->category . '][' . get_enum_element('severity', $t_bug->severity)
	             . '-' . get_enum_element('priority', $t_bug->priority) . ']</b> ';
	if($t_bug->severity == MAJOR || $t_bug->prority > NORMAL)
		$sCategory = "<font color=\"Red\">$sCategory</font>";

  echo '#', string_get_bug_view_link( $p_issue_id ), $sCategory, string_attribute( $t_bug->summary );

  if ( $t_bug->handler_id != 0 )
  {
    echo ' <font color="Blue">(', prepare_user_name( $t_bug->handler_id ), ')</font>';
  }

  echo '<br />';
}
Output example:
#040 [Interface][feature-high] Allow user to re-enter registrtion key if old one has not been expired yet. (MiSHuTka)
#041 [Interface][tweak-normal] Something with lower priority. (MiSHuTka)

Posted: 03 Oct 2006, 01:46
by q_back
how can i change me nick on this forum you guys?:)

Severity as background-color

Posted: 06 Sep 2007, 12:33
by biitli
Hi,
we enhanced mantis-changelog to show the severity of a bug as background-color:
* FEATURE: green
* TRIVIAL, TEXT, TWEAK: floralwhite
* MINOR: yellow
* MAJOR: orange
* CRASH: red
* BLOCK: darker red

see post 3221: http://www.mantisbt.org/forums/viewtopic.php?t=3221