Page 1 of 1

Problem when adding a custom bug status

Posted: 11 Jan 2011, 10:58
by mandaillou
Hi,
I want to add the status rejected to the list of status.
I followed the steps described in the Mantis documentation http://manual.mantisbt.org/manual.custo ... values.php

I created the file custom_constant_inc.php which content is:

Code: Select all

<?php
define ( 'rejected', 85 );
?>
I created the file custom_strings_inc.php which content is:

Code: Select all

<?php
	$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,85:rejected,90:closed';
	$s_rejected_bug_button = "Reject"; 
	$s_rejected_bug_title = "Reject";
	$s_email_notification_title_for_status_bug_rejected = "The following issue was REJECTED."; 
?>
I have updated the file config_inc.php which content is:

Code: Select all

	# add status rejected
	$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,
       80:resolved,85:rejected,90:closed';

	$g_status_colors['rejected'] = '#ACE7AE';

	# workflow
	$g_status_enum_workflow[NEW_]= '40:confirmed,85:rejected';
	$g_status_enum_workflow[rejected]= '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,85:rejected';
	$g_status_enum_workflow[CONFIRMED]=  '50:assigned,85:rejected';
	$g_status_enum_workflow[ASSIGNED]= '80:resolved';
	$g_status_enum_workflow[RESOLVED]= '90:closed';
	$g_status_enum_workflow[CLOSED]= '10:new';
	$g_status_enum_workflow[FEEDBACK]= '40:confirmed,85:rejected';
?>
For an issue which status is new, the status options in the drop-down list are: confirmed or @85@ ?
What did I miss ?

The file custom_strings_inc.php seems to be fine. Indeed, if I change 'confirmed' by another string for the variable 's_status_enum_string', the new value is correctly displayed.

Thanks for your help.


I use Mantis 1.2.4 on Windows XP

Re: Problem when adding a custom bug status

Posted: 11 Jan 2011, 11:17
by atrol
Set $g_status_enum_string instead of $s_status_enum_string in file config_inc.php

Re: Problem when adding a custom bug status

Posted: 11 Jan 2011, 12:50
by mandaillou
That was indeed my problem. Thanks a lot. :D

However, I now have another problem.
I can now set an issue as rejected, but depending on how I do it, the status is set to 'rejected' or 'resolved'.

1/ If I edit the issue, select 'rejected' from the drop down list and press the button 'update information', the status is correctly set.

2/ If I open/view the issue, select 'rejected' in the drop down list next to the button 'change status to', press this button, then press the button 'reject' (value set in the file custom_string_inc.php $s_rejected_bug_button), the issue status is set to 'resolved' instead of 'rejected'.
Any clue ?

Re: Problem when adding a custom bug status

Posted: 11 Jan 2011, 13:15
by atrol
Maybe this is caused by your workflow settings.
I don't have the time to try this.

Maybe a better approach:
Remove your $g_status_enum_workflow entries from your config_inc.php
Use "Manage" -> "Manage Configuration" -> "Workflow Transitions" instead

Re: Problem when adding a custom bug status

Posted: 12 Jan 2011, 10:08
by mandaillou
I followed your advice but unfortunately it didn't solve the problem.

Re: Problem when adding a custom bug status

Posted: 20 Jan 2011, 13:08
by mandaillou
I noticed that I can set the ticket as rejected if its previous state was resolved.
But if the ticket has not reached the resolved level (=80), it seems that I can't set the status as rejected (=85) directly. I have first to set it as resolved and then as rejected.