Add New Status - Please Help

Get help from other users here.

Moderators: Developer, Contributor

Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Add New Status - Please Help

Post by Jcale1QA »

Hello,

I am trying add five new statuses in Mantis version 1.2.15 and request some assistance please.
I desire an open workflow, such that any status can transition to any other status.

I hope to add these new statuses:
‘deferred’ color code #A4D3EE
‘fixed’ color code #EED8AE
‘deployed’ color code #9AFF9A
‘bug remains’ color code #FFBBFF
‘rejected’ color code #FFA500

I still hope to use these default statuses:
New
Acknowledged
Feedback
Closed

I prefer not to use these default statuses in the workflow or have them shown in lists as available selections for status.
Confirmed
Assigned
Resolved

Here is my desired workflow.
$s_status_enum_string = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

Any advice or assistance on the changes that would need to be made and how to do this would be most appreciated, as I have limited developer support on this.

Here is the proposed changes and code, based on information found in the below thread. Please note this post was in 2008, so I’m concerned that the code below is still compatible with mantis 1.2.15.
http://www.mantisbt.org/forums/viewtopi ... tus#p47493

Note I defined colors for all the desired statuses, however default colors for the default statuses still desired for use are acceptable.

Step 1
Rename customization file "config_inc.php" to "custom_config_inc.php" in the main "mantis" directory.
> mv config_inc.php custom_config_inc.php

Step 2
Create a new "config_inc.php" file in the main "mantis" directory. It should contain the following lines only.
<?php
require_once('custom_config_inc.php');
?>

Step 3
[I would like the user to have the ability to change the bug from any state to any state freely, with the exception of new, which should only transition to either acknowledged, deferred, feedback, or rejected, all of which should be able to transition back to new.]
[I am not sure if all statuses should be included here, or only the statuses being changed or added. Below I only included statutes being changed or added.]

Create the file "custom_constant_inc.php" in the main "mantis" directory.
<?php
# Customized new status
define ('fixed', 30);
define ('deployed', 40);
define ('deferred', 60);
define ('bug remains', 80);
define ('rejected', 90);
?>

Step 4

Create the file "custom_strings_inc.php" in the main "mantis" directory. It should contain the following lines. If the file also exists, add the following lines to the end of the file.

<?php
# Customize workflow status
$s_status_enum_string = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

# Customize status fixed
$s_fixed_bug_button = 'fixed';
$s_fixed_bug_title = 'Set Issue to fixed';
$s_email_notification_title_for_status_bug_fixed = "The following issue is fixed";

# Customize status deployed
$s_deployed_bug_button = 'deployed';
$s_deployed_bug_title = 'Set Issue to deployed';
$s_email_notification_title_for_status_bug_deployed = "The following issue is deployed";
?>

# Customize status deferred
$s_deferred_bug_button = 'deferred';
$s_deferred_bug_title = 'Set Issue to deferred';
$s_email_notification_title_for_status_bug_deferred = "The following issue is deferred";
?>

# Customize status bug remains
$s_bug_remains_bug_button = 'bug remains';
$s_bug_remains_bug_title = 'Set Issue to bug remains';
$s_email_notification_title_for_status_bug_bug_remains = "The following issue is set to bug remains";
?>

# Customize status rejected
$s_rejected_bug_button = 'rejected';
$s_rejected_bug_title = 'Set Issue to rejected';
$s_email_notification_title_for_status_bug_rejected = "The following issue is set to rejected";
?>

Step 5

5. Modify the file "custom_config_inc.php" in the main "mantis" directory. This file should have been created by the first step. Add the following lines to the end of the file.
# Customize status & workflow

$s_status_enum_string = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

# Customize next available status in workflow
$g_status_enum_workflow[NEW_] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[ACKNOWLEDGED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[FIXED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[DEPLOYED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[CLOSED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[DEFERRED] = '20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[FEEDBACK] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[BUG REMAINS] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

$g_status_enum_workflow[REJECTED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

# Customize status colors
$g_status_colors['new'] = '#FFFFFF';
$g_status_colors['acknowledged'] = '#FFE7BA';
$g_status_colors['fixed'] = ' #CDAA7D';
$g_status_colors['deployed'] = '#9AFF9A';
$g_status_colors['closed'] = #D6D6D6';
$g_status_colors['deferred'] = '#A4D3EE';
$g_status_colors['feedback'] = '# FFBBFF';
$g_status_colors['bug remains'] = '# FFFF00';
$g_status_colors['rejected'] = '#FFA500';
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Add New Status - Please Help

Post by atrol »

Jcale1QA wrote: Here is the proposed changes and code, based on information found in the below thread. Please note this post was in 2008, so I’m concerned that the code below is still compatible with mantis 1.2.15.
http://www.mantisbt.org/forums/viewtopi ... tus#p47493
There is a manual delivered with MantisBT (check your installation for directory doc/en)
Have also a look at our online version how to customize status values.
http://www.mantisbt.org/docs/master-1.2 ... IZE.STATUS
Please use Search before posting and read the Manual
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

Thanks for your help. I followed the instructions in the online manual. The code used is below for review along with instructions from the manual as reference. However, now the main Mantis BT login page will not show. Instead, it shows this message only, on white background:

Possible Whitespace/Error in Configuration File - Aborting. Output so far follows:
string(1) " "

Our version:
1.2.15
Schema Version 183

Step 1
In the main MantisBT directory, locate and edit file custom_constants_inc.php; (create it if it does not exist).

<?php
# Customized new status
define ('fixed', 30);
define ('deployed', 40);
define ('deferred', 60);
define ('bug remains', 80);
define ('rejected', 90);
?>

Step 2
Define the new status in the enumeration, as well as the corresponding color code.
In the main mantisbt directory, edit your config_inc.php

<?php
# Customize workflow status
$g_status_enum_string = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

# Customize status colors
$g_status_colors['fixed'] = '#CDAA7D';
$g_status_colors['deployed'] = '#9AFF9A';
$g_status_colors['deferred'] = '#A4D3EE';
$g_status_colors['bug remains'] = '#FFFF00';
$g_status_colors['rejected'] = '#FFA500';
?>


Step 3
Define the required translation strings for the new status, for each language used in the installation.
• s_status_enum_string: status codes translation (refer to the original language strings for standard values)
• s_XXXX_bug_title: title displayed in the change status page
• s_XXXX_bug_button: label for the submit button in the change status page
• s_email_notification_title_for_status_bug_XXXX: title for notification e-mails
where XXXX is the name of the new status as it was defined in g_status_enum_string above. If XXXX contains spaces, they should be replaced by underscores in the language strings names (e.g. for '35:pending user', use '$s_pending_user_bug_button')
In the main mantisbt directory, locate and edit file custom_strings_inc.php; (create it if it does not exist)

<?php
# Customize workflow status
$s_status_enum_string = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';

# Customize status fixed
$s_fixed_bug_button = 'fixed';
$s_fixed_bug_title = 'Set Issue to fixed';
$s_email_notification_title_for_status_bug_fixed = "The following issue is fixed";

# Customize status deployed
$s_deployed_bug_button = 'deployed';
$s_deployed_bug_title = 'Set Issue to deployed';
$s_email_notification_title_for_status_bug_deployed = "The following issue is deployed";
?>

# Customize status deferred
$s_deferred_bug_button = 'deferred';
$s_deferred_bug_title = 'Set Issue to deferred';
$s_email_notification_title_for_status_bug_deferred = "The following issue is deferred";
?>

# Customize status bug remains
$s_bug_remains_bug_button = 'bug remains';
$s_bug_remains_bug_title = 'Set Issue to bug remains';
$s_email_notification_title_for_status_bug_bug_remains = "The following issue is set to bug remains";
?>

# Customize status rejected
$s_rejected_bug_button = 'rejected';
$s_rejected_bug_title = 'Set Issue to rejected';
$s_email_notification_title_for_status_bug_rejected = "The following issue is set to rejected";
break;

Step 4 [This step should be optional as the manual says it can be done in the UI]
Add the new status to the workflow as required.
This can either be done from the Manage Workflow Transitions page or by manually editing config_inc.php as per the below:
# Customize next available status in workflow
$g_status_enum_workflow[NEW_] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[ACKNOWLEDGED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[FIXED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[DEPLOYED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[CLOSED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[DEFERRED] = '20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[FEEDBACK] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[BUG REMAINS] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
$g_status_enum_workflow[REJECTED] = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:deferred,70:feedback,80:bug remains,90:rejected';
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Add New Status - Please Help

Post by atrol »

Remove all closing PHP tags ?> from the last line of all the files you changed or created
Please use Search before posting and read the Manual
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

Hello, I follows instructions to remove closing PHP tags. I am seeing the following issues, any help is appreciated. Please also explain any directions specifically, on exactly what I should change, since I work in QA, and I am not a php developer. very sincere thanks.

1. two new status do not show up at all. They are:
'Review' and 'bug remains'

2. several colors are incorrect:
'new' should be white, it is correct.
'acknowledged' should be light pink, it is correct.
Issues:
'fixed' should have been light blue but is pink
'deployed' have been light green but is orange
'closed' should have been grey but it is light blue
'review' should be yellow but review is missing
'bug remains' should be orange but is missing
'rejected' should be different light blue but it is light green
'deferred' should be light purple but it is grey.

here is the code:

Step 1
In the main MantisBT directory, locate and edit file custom_constants_inc.php; (create it if it does not exist).

<?php
# Customized new status
define ('new', 10);
define ('acknowledged', 20);
define ('fixed', 30);
define ('deployed', 40);
define ('closed', 50);
define ('review', 60);
define ('bug remains', 70);
define ('rejected’, 80);
define ('deferred', 90);

Step 2
Define the new status in the enumeration, as well as the corresponding color code.
In the main mantisbt directory, edit your config_inc.php

<?php
# Customize workflow status
$g_status_enum_string = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:review,70:bug remains,80:rejected,90:deferred';

# Customize status colors
$g_status_colors['new'] = '#FFFFFF';
$g_status_colors['acknowledged'] = '#FF99CC';
$g_status_colors['fixed'] = '#CCFFFF';
$g_status_colors['deployed'] = '#66FF33';
$g_status_colors['closed'] = '#C8C8C8';
$g_status_colors['review'] = '#FFFF33';
$g_status_colors['bug remains'] = '#FF9933';
$g_status_colors['rejected'] = '#66CCCC';
$g_status_colors['deferred'] = '#9999CC';

Step 3
Define the required translation strings for the new status, for each language used in the installation.
• s_status_enum_string: status codes translation (refer to the original language strings for standard values)
• s_XXXX_bug_title: title displayed in the change status page
• s_XXXX_bug_button: label for the submit button in the change status page
• s_email_notification_title_for_status_bug_XXXX: title for notification e-mails
where XXXX is the name of the new status as it was defined in g_status_enum_string above. If XXXX contains spaces, they should be replaced by underscores in the language strings names (e.g. for '35:pending user', use '$s_pending_user_bug_button')
In the main mantisbt directory, locate and edit file custom_strings_inc.php; (create it if it does not exist)

<?php
# Customize workflow status
$s_status_enum_string = '10:new,20:acknowledged,30:fixed,40:deployed,50:closed,60:review,70:bug remains,80:rejected,90:deferred';

# Customize status new
$s_fixed_bug_button = 'new';
$s_fixed_bug_title = 'Set Issue to new';
$s_email_notification_title_for_status_bug_new = "A new issue has been reported";

# Customize status acknowledged
$s_fixed_bug_button = 'acknowledged';
$s_fixed_bug_title = 'Set Issue to acknowledged;
$s_email_notification_title_for_status_bug_acknowledged = "The following issue has been acknowledged";

# Customize status fixed
$s_fixed_bug_button = 'fixed';
$s_fixed_bug_title = 'Set Issue to fixed';
$s_email_notification_title_for_status_bug_fixed = "The following issue has been fixed, but is not yet deployed";

# Customize status deployed
$s_deployed_bug_button = 'deployed';
$s_deployed_bug_title = 'Set Issue to deployed';
$s_email_notification_title_for_status_bug_deployed = "The following issue is now deployed";

# Customize status closed
$s_fixed_bug_button = 'closed';
$s_fixed_bug_title = 'Set Issue to closed';
$s_email_notification_title_for_status_bug_closed = "The following issue is now closed";

# Customize status review, replaces feedback
$s_deferred_bug_button = 'review';
$s_deferred_bug_title = 'Set Issue to review';
$s_email_notification_title_for_status_bug_review = "The following issue needs review";

# Customize status bug remains
$s_bug_remains_bug_button = 'bug remains';
$s_bug_remains_bug_title = 'Set Issue to bug remains';
$s_email_notification_title_for_status_bug_bug_remains = "The following issue is set to bug remains";

# Customize status rejected
$s_rejected_bug_button = 'rejected';
$s_rejected_bug_title = 'Set Issue to rejected';
$s_email_notification_title_for_status_bug_rejected = "The following issue is set to rejected";

# Customize status deferred
$s_fixed_bug_button = 'deferred';
$s_fixed_bug_title = 'Set Issue to deferred';
$s_email_notification_title_for_status_bug_deferred = "The following issue is set to deferred";
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Add New Status - Please Help

Post by atrol »

I will help you, but first of all you should again think about what you need.

I wouldn't introduce these status values as some of them are redundant with values of standard field "Resolution".
e.g. "Rejected" is "won't fix", ...

"Closed" should be the final status as this is the default status where issues are considered to be read-only for users (dependinng on their access level)
Please use Search before posting and read the Manual
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

Thanks, however, we are a small organization and don't want to use the field Resolution. To keep things simple we will only use status to know the state of the bug. We only have about 3-5 users. And the statuses we have requested will help use migrate to mantis from our previous bug tracker.
Last edited by Jcale1QA on 24 Sep 2013, 15:25, edited 1 time in total.
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

Also, closed is intended to be the final status, but not read only. I prefer an open workflow where any state can be set to any other state.

The intended order is,
New->acknowledged->fixed[for us this means fixed but not released for testing]->deployed[released for testing which is why it should be green]->closed[which means confirmed the fix] and then if the bug cannot be closed, the user has these options:

review[need to discuss], bug remains[fix was not successful],rejected[fix is not supportable], and deferred[bug to be fixed later]

However, I would like the ability for the user to set any state from any state please.

Your help is very greatly appreciated.
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Add New Status - Please Help

Post by atrol »

Step 1)
Remove custom_constants_inc.php (we don't need it as we will use the Manage Workflow Transitions page if there is any change needed)

Step 2)
Add the following lines to file config_inc.php

Code: Select all

	# Customize workflow status
	$g_status_enum_string = '10:new,30:acknowledged,35:fixed,45:deployed,55:review,65:bug remains,75:rejected,85:deferred,90:closed';
	
	# Needed as you don't want the status "assigned"
	$g_auto_set_status_to_assigned	= OFF;
	
	# Customize status colors
	$g_status_colors['new'] = '#FFFFFF';
	$g_status_colors['acknowledged'] = '#FF99CC';
	$g_status_colors['fixed'] = '#CCFFFF';
	$g_status_colors['deployed'] = '#66FF33';
	$g_status_colors['review'] = '#FFFF33';
	$g_status_colors['bug remains'] = '#FF9933';
	$g_status_colors['rejected'] = '#66CCCC';
	$g_status_colors['deferred'] = '#9999CC';
	$g_status_colors['closed'] = '#C8C8C8';
Step 3)
Create a new custom_strings_inc.php with the following content

Code: Select all

<?php
	$s_status_enum_string = '10:new,30:acknowledged,35:fixed,45:deployed,55:review,65:bug remains,75:rejected,85:deferred,90:closed';

	# Customize status fixed
	$s_fixed_bug_button = 'fixed';
	$s_fixed_bug_title = 'Set Issue to fixed';
	$s_email_notification_title_for_status_bug_fixed = 'The following issue has been fixed, but is not yet deployed';
	
	# Customize status deployed
	$s_deployed_bug_button = 'deployed';
	$s_deployed_bug_title = 'Set Issue to deployed';
	$s_email_notification_title_for_status_bug_deployed = 'The following issue is now deployed';
	
	# Customize status review
	$s_review_bug_button = 'review';
	$s_review_bug_title = 'Set Issue to review';
	$s_email_notification_title_for_status_bug_review = 'The following issue needs review';
	
	# Customize status bug remains
	$s_bug_remains_bug_button = 'bug remains';
	$s_bug_remains_bug_title = 'Set Issue to bug remains';
	$s_email_notification_title_for_status_bug_bug_remains = 'The following issue is set to bug remains';

	# Customize status rejected
	$s_rejected_bug_button = 'rejected';
	$s_rejected_bug_title = 'Set Issue to rejected';
	$s_email_notification_title_for_status_bug_rejected = 'The following issue is set to rejected';

	# Customize status deferred
	$s_deferred_bug_button = 'deferred';
	$s_deferred_bug_title = 'Set Issue to deferred';
	$s_email_notification_title_for_status_bug_deferred = 'The following issue is set to deferred';
	
Step 4)
Have fun
Please use Search before posting and read the Manual
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

Hello,
I greatly appreciate your help!
I tried the changes you suggested, however, now these issues are seen:

1. these statuses are missing:
fixed
deployed
review
rejected
deferred

2.these status are present but should not be:
feedback
assigned
resolved

Any help is very appreciated.
Attachments
workflow.png
workflow.png (15.25 KiB) Viewed 57178 times
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Add New Status - Please Help

Post by atrol »

Use the button "Delete Settings" at the bottom of the page to get rid of any previous configurations you tried.
Please use Search before posting and read the Manual
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

Thanks, I did this as you suggested. Mantis said Operation successful. However the same issues persist.
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Add New Status - Please Help

Post by atrol »

Are you sure that you set $g_status_enum_string in config_inc.php to

Code: Select all

$g_status_enum_string = '10:new,30:acknowledged,35:fixed,45:deployed,55:review,65:bug remains,75:rejected,85:deferred,90:closed';
Check also page Manage > Manage Configuration
Click "Reset Filter"

Are there any entries for status_enum_workflow containing the values 20, 40, 50 or 80?
If so, remove them.
Please use Search before posting and read the Manual
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

sincere thanks.

I tried to reset the filter, however the issues remain.

Confirmed, I used this line:
$g_status_enum_string = '10:new,30:acknowledged,35:fixed,45:deployed,55:review,65:bug remains,75:rejected,85:deferred,90:closed';

I attached screenshots so you can review the code. Attachment of screenshot for custom_strings will follow in the next response.

Please help me find status _enum_workflow so I can check for values 20, 40, 50, or 80, which file is this line in?

I checked the two files we have left:
config_inc.php
custom_strings_inc.php

However, I don't see the line status_enum_workflow in those files.

Thanks for your help.
Jcale1QA
Posts: 19
Joined: 18 Sep 2013, 15:56

Re: Add New Status - Please Help

Post by Jcale1QA »

custom_strings_inc screenshot.
Post Reply