Custom Status Values

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Seb
Posts: 7
Joined: 30 Mar 2005, 15:20

Custom Status Values

Post by Seb »

Has anybody been successful with creating new status values?

I have followed the steps in the Customizing Status Values section provided in the Mantis manual, but have been unsuccessful. I followed these steps to the letter just to see if I could get their example working first.

The error lies within the custom_constant_inc.php, it says that TEST in undefined.

I'm completely new to this so I am unsure as to how I should go about fixing this.

Another detail which may be of use, I don't know, is that the files custom_constant_inc.php and custom_strings_inc.php did not exist. I created the files and added the code supplied with the steps provided in the manual. Could this be where I went wrong?

Thanks for your time.

Seb
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

You are correct, the custom_* files don't exist in the distribution (either does config_inc.php). That way when you upgrade the code, your customizations are left untouched.

There is a typo in the manual. It should read

Code: Select all

define ( 'TEST', 60 );
Seb
Posts: 7
Joined: 30 Mar 2005, 15:20

Post by Seb »

Thanks for replying.

I amde the changes but I'm getting an error... an opposite of sorts. It now says --

"Notice: Constant TEST already defined in ..\mantis\custom_constant_inc.php on line 2"

Again, I've followed the instructions closely - where else could it have been defined?

My thanks once again.
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

The only constants used in mantis are defined in core/constants_inc.php. AFAIK, we don't use TEST.

The example as documented works for me, so maybe there's a typo somewhere.
Guest

Post by Guest »

Nice one, I got it working. I checked the constants_inc.php in the core directory and found TEST to be defined in there. I must have stuck it in there at some point to play around, though my doing so obvioulsy slipped my mind.

Your help is appreciated.
kdf

Post by kdf »

Thanks! I was wondering about that one too!

I have a couple of questions to add:

1. When you are editing the workflow, should you use spaces or underscores if you have a status that is more than one word? e.g.
$g_status_enum_workflow[RESOLVED IN QA] = '50:assigned,80:resolved,90:closed';
Should it be "RESOLVED IN QA" or "RESOLVED_IN_QA"?
(I guess I can figure this out myself by trying but I thought I'd throw it in since I was going to ask this next question anyway...)

2. What if you want to customize the statuses after you've already been using Mantis for a while? I was thinking I could make the changes described in the manual, and then to change the data I could update the following tables to change the statuses as appropriate (not all of them would change, but some of them):
- bug_table (status)
- bug_history_table (I guess old_value and new_value where field_name="status")

Can someone please give me any advice as to whether I'm missing any data that might need to be updated, or other things I should watch out for? I did import the bugs in the first place from our old system and that worked nicely, so I expect this to be too do-able

(It would be nice if you could just add new statuses and set old ones as "inactive" - so then you wouldn't have to change anything - but I don't even want them to show up at all---to limit confusion---so I think I just need to get rid of them)

Thanks!
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

kdf wrote:Thanks! I was wondering about that one too!

I have a couple of questions to add:

1. When you are editing the workflow, should you use spaces or underscores if you have a status that is more than one word? e.g.
$g_status_enum_workflow[RESOLVED IN QA] = '50:assigned,80:resolved,90:closed';
Should it be "RESOLVED IN QA" or "RESOLVED_IN_QA"?
(I guess I can figure this out myself by trying but I thought I'd throw it in since I was going to ask this next question anyway...)
These need underscores in them as they are PHP constants. Spaces aren't allowed.
2. What if you want to customize the statuses after you've already been using Mantis for a while? I was thinking I could make the changes described in the manual, and then to change the data I could update the following tables to change the statuses as appropriate (not all of them would change, but some of them):
- bug_table (status)
- bug_history_table (I guess old_value and new_value where field_name="status")

Can someone please give me any advice as to whether I'm missing any data that might need to be updated, or other things I should watch out for? I did import the bugs in the first place from our old system and that worked nicely, so I expect this to be too do-able
I believe that those are the only two places where status is stored. The only issue might be that there is a general assumption that status values increase as you progress the issue, and that CLOSED (value 100) is the last one.
(It would be nice if you could just add new statuses and set old ones as "inactive" - so then you wouldn't have to change anything - but I don't even want them to show up at all---to limit confusion---so I think I just need to get rid of them)

Thanks!
I think that this has been requested in the tracker at http://bugs.mantisbt.org/ .
kdf

Post by kdf »

Thanks for the reply! I'm testing it now and it appears to work so far.
kdf

Post by kdf »

Oh, another reminder to people is to set $g_bug_resolved_status_threshold in config_inc.php if you are using something other than "resolved" to designate issues as resolved/fixed. Otherwise the right items don't show up in My View.

(can look this up in the manual: http://manual.mantisbt.org/manual.confi ... ttings.php)

Even after setting this, it was working a little strangely for me so in the end I just decided to stick with "resolved" for that level, which I now think is an appropriate title anyway so I'm glad I came around!
Post Reply