Creating custom statuses

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
micah26
Posts: 3
Joined: Nov 17, 2008 2:33 am

Creating custom statuses

Post by micah26 » Nov 17, 2008 2:36 am

I'm currently using Mantis 1.1.2 and am wondering if there is an easy way to do this. The manual shows a way to do this, but I had trouble with it. The manual page is also 3 years old. Is there a tutorial for this and/or can someone update the manual.
I'm interested in statuses like testing and ready for production.

Thank you,
Micah

jb_mantis
Posts: 63
Joined: Oct 14, 2008 7:41 am
Location: Columbus, Ohio, USA

Re: Creating custom statuses

Post by jb_mantis » Nov 17, 2008 8:48 am

I was interested in this a while back and researched it some. I never implemented it, but here are the changes I think would need to be made. Hopefully someone else can confirm. The settings below are for a new status of "In progress". Replace with your status name.

add/update to custom_constant_inc.php:
<?php
define ( 'IN_PROGRESS', 70 );
?>

add/update to custom_strings_inc.php:
<?php
if ( lang_get_current() == 'english' ) {
$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,70:in progress,80:resolved,90:closed';
$s_in_progress_bug_button = "Issue In Progress";
$s_in_progress_bug_title = "Set Issue In Progress";
$s_email_notification_title_for_status_bug_in_progress = "The following issue is IN PROGRESS.";
}
?>

add/update to config_inc.php:
$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,70:in_progress,80:resolved,90:closed';
$g_status_colors['in progress'] = '#C7E3FF';
$g_status_enum_workflow[IN_PROGRESS] = '20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed';
-Joe
Mantis Version: 1.1.2
Disclaimer: Answers are based on the Mantis version above and may be inaccurate for newer/older versions which may have different configuration options and/or functionality.

olegos
Posts: 72
Joined: Mar 12, 2007 3:24 pm

Re: Creating custom statuses

Post by olegos » Nov 17, 2008 8:02 pm

What problems did you run into?

I created a new status just now by following this, with no problems at all (except that in step 4 I defined the workflow transitions through the GUI rather than editing config_inc.php).

[MantisBT 1.2.0a2]

micah26
Posts: 3
Joined: Nov 17, 2008 2:33 am

Re: Creating custom statuses

Post by micah26 » Nov 17, 2008 10:50 pm

olegos wrote:What problems did you run into?

I created a new status just now by following this, with no problems at all (except that in step 4 I defined the workflow transitions through the GUI rather than editing config_inc.php).

[MantisBT 1.2.0a2]

I had trouble seeing the new status. I'll try the steps the last poster showed and see if it helps.

Thanks,
Micah

[Mantis 1.1.2]

micah26
Posts: 3
Joined: Nov 17, 2008 2:33 am

Re: Creating custom statuses

Post by micah26 » Nov 19, 2008 11:49 pm

micah26 wrote:
olegos wrote:What problems did you run into?

I created a new status just now by following this, with no problems at all (except that in step 4 I defined the workflow transitions through the GUI rather than editing config_inc.php).

[MantisBT 1.2.0a2]

I had trouble seeing the new status. I'll try the steps the last poster showed and see if it helps.

Thanks,
Micah

[Mantis 1.1.2]
It worked great! Thank you!
Micah

torenware
Posts: 1
Joined: Mar 24, 2009 2:06 am

Re: Creating custom statuses

Post by torenware » Mar 24, 2009 2:13 am

One caveat: I just spent several hours trying to figure out why the example didn't work with the current stable download. I had updated from 0.19, and the upgrade went fine. It seemed as if Mantis was not looking in config_inc.php to pull in my new workflow entries.

After running Mantis through the debugger, it turns out that Mantis will not look at your workflow configs if there is already a setting in the mantis_config_table in the database. config_get will never go to the settings files if the database has already cached status_enum_workflow.

The workaround is to delete the item from the cache:

Code: Select all

delete from mantis_config_table where config_id = 'status_enum_workflow';
Mantis will then look at your config file for this information, and you can go into Manage pages to finish configuring the workflow.

duwil
Posts: 46
Joined: Jul 08, 2008 7:14 am

Re: Creating custom statuses

Post by duwil » Nov 13, 2009 4:17 am

torenware wrote:config_get will never go to the settings files if the database has already cached status_enum_workflow.

The workaround is to delete the item from the cache:

Code: Select all

delete from mantis_config_table where config_id = 'status_enum_workflow';
Mantis will then look at your config file for this information, and you can go into Manage pages to finish configuring the workflow.
I ran into a similar problem months ago and I think it's better not to use the config file at all when possible to avoid confusion, my config_inc.php has only few lines, only the ones I can't configure via web interface.

tetsunami
Posts: 26
Joined: Apr 21, 2010 9:45 am

Re: Creating custom statuses

Post by tetsunami » Apr 21, 2010 3:41 pm

so i want to ask something about the states
in
my_view_page.php

how can i add to the states bar (the colored one) the new state i just add


thansk a lot for the help . :P

atrol
Site Admin
Posts: 7652
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Creating custom statuses

Post by atrol » Apr 21, 2010 4:34 pm

If you are following the given instructions how to add a new status, you don't have to do anything more.
The new status will appear in bar without any further modification.
Please use Search before posting and read the Manual

tetsunami
Posts: 26
Joined: Apr 21, 2010 9:45 am

Re: Creating custom statuses

Post by tetsunami » Apr 22, 2010 8:48 am

tetsunami wrote:so i want to ask something about the states
in
my_view_page.php

how can i add to the states bar (the colored one) the new state i just add


thansk a lot for the help . :P
SO i only add in the gui state the right workflow and then the colores bar just update :mrgreen: my bad

Post Reply