View Issue Details

IDProjectCategoryView StatusLast Update
0006128mantisbtbugtrackerpublic2019-08-25 12:36
ReporterMattB Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version1.0.0a3 
Target Version2.22.0Fixed in Version2.22.0 
Summary0006128: Ability to add monitors to a bug when the bug is first reported
Description

I've got a simple patch so that the reporter can add users as monitors during the initial bug report. This is really useful in our environment and would be nice to see it in a Mantis release at some point.

Additional Information

Three changes are needed.

Add to bug_report_advanced_page.php, line 300:

<!-- Monitors of this bug -->
<!-- MattB 
<tr <?php echo helper_alternate_class() ?>>
        <td class="category">
                <?php echo lang_get( 'monitored_by') ?>
        </td>
        <td>
                <select name="monitors[]" multiple="multiple" size="10">
                        <?php echo print_project_user_option_list( $t_project_id ) ?>
                </select>
        </td>
</tr>

Add to bug_report.php above the email_new_bug statement:

# Need to add the monitors
# MattB
$t_monitors = gpc_get_int_array( 'monitors', null );
foreach ($t_monitors as $t_recipient)
{
   bug_monitor( $t_bug_id, $t_recipient );
}

Make a configuration change:

        $g_notify_flags['new']  = array('bugnotes'      => OFF,
                                        'monitor'       => ON);

(this can also be done per-project using the config screens if necessary)

TagsNo tags attached.

Relationships

has duplicate 0022559 closedatrol Add monitoring users at report time 
related to 0016811 new Plugin to notify multiple users on Issue create 
related to 0025815 closeddregad Users can't add monitors if access < show_monitor_list_threshold and >= monitor_add_others_bug_threshold 
related to 0025827 closeddregad Improve documentation for monitors-related configs 

Activities

MattB

MattB

2005-08-11 12:26

reporter   ~0011173

BTW, this should probably be a configurable item nbut I haven't had chance to sort the code for that yet!!

MattB

MattB

2005-08-18 10:03

reporter   ~0011235

Oops, forgot to close the comment in the first block, it should be:

<!-- Monitors of this bug -->
<!-- MattB -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'monitored_by') ?>
</td>
<td>
<select name="monitors[]" multiple="multiple" size="10">
<?php echo print_project_user_option_list( $t_project_id ) ?>
</select>
</td>
</tr>

mlovell

mlovell

2006-02-01 18:16

reporter   ~0012059

This seems like it would be a nice feature to add to Mantis. Thanks very much for contributing the code; I've merged it into the local installation at my company.

MattB

MattB

2006-02-01 18:17

reporter   ~0012060

We use this functionality all the time in our company. I would love to see it in the main Mantis codebase.

mlovell

mlovell

2006-02-08 19:00

reporter   ~0012118

I noticed that an "invalid argument in foreach" was appearing when reporting issues with the above code in bug_report.php. The error went away when I encompassed the foreach loop with <pre>

if ( count( $t_monitors) > 0 ) { ... }
</pre>

mlovell

mlovell

2006-02-24 15:03

reporter   ~0012225

With the above code in place, I don't believe email is being sent to monitors upon a New issue being reported. I haven't debugged Mantis operation, but I've checked maillogs sufficient to believe the observations I've heard.

What is necessary to change in order to let monitors be informed of a new issue? I've gone into Email Notifications as administrator and checked the appropriate box there, but I fear that perhaps some other option (in config_inc.php) might still be preventing email.

Thanks in advance for any suggestions.

dwoods

dwoods

2006-05-03 02:09

reporter   ~0012769

mlovell:

I think that if you move the suggested changes ABOVE email_new_bug() instead of below it, you the monitors will be notified on new bugs.

I haven't tried it but it should work.

sawsedge

sawsedge

2006-05-19 12:38

reporter   ~0012879

I'm glad to see others request this. Definitely a useful thing when you want to CC a group.

ericb

ericb

2006-05-19 21:29

reporter   ~0012882

sawsedge +1

sawsedge

sawsedge

2006-05-22 13:47

reporter   ~0012889

I implemented MattB's code in my Mantis install and it works well, except it is missing the "monitored by" list for the bug update page. I have not personally figured out how to add this. If I do, I'll post it, but it someone figures it out first, great.

lig

lig

2006-07-04 12:56

reporter   ~0013064

i think it will be very usefull to make possibility to assign category to a list of users or add setting for category different from "asigned" such as "initial CC" that will be a list users

rombert

rombert

2011-08-18 14:24

reporter   ~0029515

Thank you for the report and suggested fix. Would you consider submitting pull requests for this functionality? This would greatly increase the speed of including these changes in MantisBT.

Ideally you would submit pull requests for both the master and master-1.2.x branches at https://github.com/mantisbt/mantisbt .

roentgen

roentgen

2012-03-23 04:45

reporter   ~0031513

Is there some adapted code for Mantis 1.2.x in git or somewhere else?
Thank you.

AlokSharma

AlokSharma

2019-01-29 08:54

reporter   ~0061324

Hi @MattB

Can you please provide the patch for mantis 2.4.0.
As I couldn't find the same lines of code in the current core files of mantis.

sach

sach

2019-05-17 18:47

reporter   ~0062089

@MattB would it be possible to get the patch for Mantis 2.x?

dregad

dregad

2019-05-19 13:40

developer   ~0062096

I adapted @MattB's original patch to latest Master, adding some missing security bits to make sure the functionality respects the monitoring issues configuration (i.e. reporter needs to be allowed to add other users to the monitoring list as set with$g_monitor_add_others_bug_threshold, and to be included on the list users need to have $g_monitor_bug_threshold).

Please see PR https://github.com/mantisbt/mantisbt/pull/1513. I only performed minimal testing, so your feedback (either here or directly on the PR) would be appreciated.

Related Changesets

MantisBT: master 179ef093

2019-05-19 09:23

dregad


Details Diff
Allow adding monitors when reporting an issue

By adding `monitors` to the $g_bug_report_page_fields array, users
having $g_monitor_add_others_bug_threshold access level will be able
to select users to add to the issue's monitoring list.

Monitors will only be notified of the submission if both their e-mail
prefs and the flags allow it (`$g_notify_flags['new']['monitor'] = ON`).

Fixes 0006128
Affected Issues
0006128
mod - bug_report.php Diff File
mod - bug_report_page.php Diff File
mod - config_defaults_inc.php Diff File
mod - docbook/Admin_Guide/en-US/config/fields.xml Diff File