mantis sends RESOLVED email when status changed to TESTING

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mushu
Posts: 146
Joined: Jan 04, 2017 12:41 pm

mantis sends RESOLVED email when status changed to TESTING

Post by mushu » Jun 29, 2018 11:37 am

Mantis 2.15.0

What could cause the wrong email to be sent? We put a ticket into TESTING status and it sent an email saying RESOLVED. Where should I look, the config files perhaps? Actually, it has BOTH status texts:



The following issue has been RESOLVED.
======================================================================
http://server:8000/view.php?id=651
======================================================================
Reported By: RP
Assigned To: ET
======================================================================
Project: LID
Issue ID: 651
Category: Bug Fix
Reproducibility: always
Severity: minor
Priority: urgent
Status: testing

mushu
Posts: 146
Joined: Jan 04, 2017 12:41 pm

Re: mantis sends RESOLVED email when status changed to TESTING

Post by mushu » Jul 02, 2018 1:22 pm

MORE INFO:

Code: Select all

J:\MantisBT2150\config>type custom_strings_inc.php
<?php
        $s_status_enum_string = '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:design,70:development,80:resolved,85:testing,90:closed';
        $s_design_bug_title = 'Currently in Design';
        $s_design_bug_button = 'Put in Design';
        $s_email_notification_title_for_status_bug_design = 'The following issue is in DESIGN.';
        $s_deferred_bug_title = 'Currently Deferred';
        $s_deferred_bug_button = 'Put in Deferred';
        $s_email_notification_title_for_status_bug_deferred = 'The following issue is DEFERRED.';
        $s_development_bug_title = 'Currently in Development';
        $s_development_bug_button = 'Put in Development';
        $s_email_notification_title_for_status_bug_development = 'The followingissue is in DEVELOPMENT.';
        $s_testing_bug_title = 'Currently in Testing';
        $s_testing_bug_button = 'Put in Testing';
        $s_email_notification_title_for_status_bug_testing = 'The following issue is in TESTING.';
and

Code: Select all

J:\MantisBT2150\config>type custom_constants_inc.php
<?php
        # Custom status codes
        define( 'DEFERRED', 15 );
        define( 'DESIGN', 60 );
        define( 'DEVELOPMENT', 70 );
        define( 'TESTING', 85 );
and in config\config_inc.php:

Code: Select all

$g_status_enum_string = '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:design,70:development,80:resolved,85:testing,90:closed';
So can anyone see anything wrong? Why would we be able to put the issue into TESTING status and yet Mantis generates a RESOLVED email message?

mushu
Posts: 146
Joined: Jan 04, 2017 12:41 pm

Re: mantis sends RESOLVED email when status changed to TESTING

Post by mushu » Jul 16, 2018 3:19 pm

Just wondering if someone can tell me which files control this so I can at least start to troubleshoot it. I don't know enough about Mantis to know how it creates and sends emails based on which ticket status.

TIA!

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

Re: mantis sends RESOLVED email when status changed to TESTING

Post by atrol » Jul 16, 2018 4:01 pm

Your problem is that you have set

Code: Select all

70:development,80:resolved,85:testing,90:closed';
It would have been better if you had set

Code: Select all

70:development,75:testing,80:resolved,90:closed';
Mantis sends the resolved message if the status is set to a value > $g_bug_resolved_status_threshold (default is 80 / RESOLVED)

Unfortunately you can't change it in a simple way now, as you would have to change existing data.

This happens in bug_update.php

Code: Select all

# Determine whether the new status will reopen, resolve or close the issue.
# Note that multiple resolved or closed states can exist and thus we need to
# look at a range of statuses when performing this check.
$t_resolved_status = config_get( 'bug_resolved_status_threshold' );
$t_closed_status = config_get( 'bug_closed_status_threshold' );
$t_reopen_resolution = config_get( 'bug_reopen_resolution' );
$t_resolve_issue = false;
$t_close_issue = false;
$t_reopen_issue = false;
if( $t_existing_bug->status < $t_resolved_status &&
	$t_updated_bug->status >= $t_resolved_status &&
	$t_updated_bug->status < $t_closed_status
) {
	$t_resolve_issue = true;
...	
...
# Send a notification of changes via email.
if( $t_resolve_issue ) {
	email_resolved( $f_bug_id );
	email_relationship_child_resolved( $f_bug_id );
} else if( $t_close_issue ) {
...
...
Please use Search before posting and read the Manual

mushu
Posts: 146
Joined: Jan 04, 2017 12:41 pm

Re: mantis sends RESOLVED email when status changed to TESTING

Post by mushu » Jul 17, 2018 1:05 pm

So which tables in mySQL would I have to globally change the 85 to a 75 in? We have SQL guys that could do that if it would solve this problem. Then I would change the codes in the Mantis config at the same time and hopefully solve this problem.

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

Re: mantis sends RESOLVED email when status changed to TESTING

Post by atrol » Jul 17, 2018 3:42 pm

Current status of an issue is stored in mantis_bug_table column status.
The history of status values is stored in mantis_bug_history_table columns old_value and new_value where column_name is status

There might exist stored filters where this status value was used.
Check mantis_filters_table column filter_string
It's not that easy, as the filter_string is json-encoded and you have to change just a small part of the column.

Check als Workflow Transition page if you have changed something for this status.
If so, it's stored in mantis_config_table, but it would be easier to use the UI to adjust the settings after the change.

I hope I did not forget something.
I recommend to try this in a separate database copy before going in production.
Please use Search before posting and read the Manual

mushu
Posts: 146
Joined: Jan 04, 2017 12:41 pm

Re: mantis sends RESOLVED email when status changed to TESTING

Post by mushu » Jul 17, 2018 3:48 pm

Thank you for that info. We have a separate DEV server setup, including a DEV mySQL installation, for testing new Mantis versions prior to pushing into production for just this situation.

mushu
Posts: 146
Joined: Jan 04, 2017 12:41 pm

Re: mantis sends RESOLVED email when status changed to TESTING

Post by mushu » Jul 19, 2018 1:28 pm

Associated database edits appear to have worked, with one exception: even thought the config screen looks correct, it no longer sends emails when status changes to TESTING (code 75). All other status changes correctly send email. Perhaps there's one more place to make the change from code 85 to 75?

Code: Select all

status_enum_workflow = 
array (
  10 => '30:acknowledged,15:deferred,20:feedback,40:confirmed,50:assigned,60:design,70:development,75:testing,80:resolved,90:closed',
  15 => '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:design,70:development,75:testing,80:resolved,90:closed',
  20 => '10:new,15:deferred,30:acknowledged,40:confirmed,50:assigned,60:design,70:development,75:testing,80:resolved,90:closed',
  30 => '10:new,15:deferred,20:feedback,40:confirmed,50:assigned,60:design,70:development,75:testing,80:resolved,90:closed',
  40 => '10:new,15:deferred,20:feedback,30:acknowledged,50:assigned,60:design,70:development,75:testing,80:resolved,90:closed',
  50 => '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,60:design,70:development,75:testing,80:resolved,90:closed',
  60 => '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,50:assigned,70:development,75:testing,80:resolved,90:closed',
  70 => '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:design,75:testing,80:resolved,90:closed',
  75 => '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:design,70:development,80:resolved,90:closed',
  80 => '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:design,70:development,75:testing,90:closed',
  90 => '10:new,15:deferred,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:design,70:development,75:testing,80:resolved',
)
and

Code: Select all

notify_flags =
...
  'testing' => 
  array (
    'reporter' => 1,
    'handler' => 1,
    'monitor' => 1,
    'bugnotes' => 1,
    'category' => 1,
    'threshold_max' => 0,
  ),
...
Thoughts on that?

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

Re: mantis sends RESOLVED email when status changed to TESTING

Post by atrol » Jul 19, 2018 4:40 pm

Check if "E-mail on Status Change" is enabled on page "My Account" > "Preferences"
Please use Search before posting and read the Manual

mushu
Posts: 146
Joined: Jan 04, 2017 12:41 pm

Re: mantis sends RESOLVED email when status changed to TESTING

Post by mushu » Jul 20, 2018 12:36 pm

Perfect. Thank you.

Post Reply