View Issue Details

IDProjectCategoryView StatusLast Update
0006128mantisbtbugtrackerpublic2019-06-03 03:12
ReporterMattB Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
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 resolveddregad Users can't add monitors if access < show_monitor_list_threshold and >= monitor_add_others_bug_threshold 
related to 0025827 resolveddregad 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 13:23:46

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

Issue History

Date Modified Username Field Change
2005-08-11 12:04 MattB New Issue
2005-08-11 12:26 MattB Note Added: 0011173
2005-08-18 10:03 MattB Note Added: 0011235
2006-02-01 18:16 mlovell Note Added: 0012059
2006-02-01 18:17 MattB Note Added: 0012060
2006-02-08 19:00 mlovell Note Added: 0012118
2006-02-24 15:03 mlovell Note Added: 0012225
2006-05-03 02:09 dwoods Note Added: 0012769
2006-05-19 12:38 sawsedge Note Added: 0012879
2006-05-19 21:29 ericb Note Added: 0012882
2006-05-22 13:47 sawsedge Note Added: 0012889
2006-07-04 12:56 lig Note Added: 0013064
2011-07-26 08:36 rombert Status new => confirmed
2011-07-26 08:36 rombert Target Version => 1.2.6
2011-07-26 09:53 jreese Target Version 1.2.6 => 1.2.7
2011-08-18 14:24 rombert Note Added: 0029515
2011-08-22 10:49 jreese Target Version 1.2.7 => 1.2.8
2011-09-06 10:33 jreese Target Version 1.2.8 => 1.2.9
2011-12-06 06:34 rombert Category email => bugtracker
2012-03-04 09:23 atrol Target Version 1.2.9 => 1.2.10
2012-03-23 02:47 roentgen Sponsorship Added roentgen: US$ 10
2012-03-23 02:47 roentgen Sponsorship Total 0 => 10
2012-03-23 04:45 roentgen Note Added: 0031513
2012-04-02 02:33 atrol Target Version 1.2.10 => 1.2.11
2012-06-06 23:54 jreese Target Version 1.2.11 => 1.2.12
2012-11-10 19:04 dregad Target Version 1.2.12 => 1.2.13
2013-01-22 09:48 dregad Target Version 1.2.13 => 1.2.14
2013-01-29 09:28 dregad Target Version 1.2.14 => 1.2.15
2013-04-12 09:57 dregad Target Version 1.2.15 => 1.2.16
2014-01-12 11:45 atrol Relationship added related to 0016811
2014-01-23 17:47 atrol Target Version 1.2.16 =>
2017-03-21 11:52 atrol Relationship added has duplicate 0022559
2019-01-29 08:54 AlokSharma Note Added: 0061324
2019-05-17 18:47 sach Note Added: 0062089
2019-05-18 08:59 dregad Additional Information Updated View Revisions
2019-05-19 13:32 dregad Changeset attached => MantisBT i6128-new-issue-add-monitors 8b565c01
2019-05-19 13:32 dregad Assigned To => dregad
2019-05-19 13:32 dregad Status confirmed => resolved
2019-05-19 13:32 dregad Resolution open => fixed
2019-05-19 13:40 dregad Status resolved => assigned
2019-05-19 13:40 dregad Note Added: 0062096
2019-05-19 13:40 dregad Changeset removed MantisBT i6128-new-issue-add-monitors 8b565c01 =>
2019-05-19 13:41 dregad Severity minor => feature
2019-05-19 13:41 dregad Target Version => 2.22.0
2019-05-30 12:56 dregad Relationship added related to 0025815
2019-05-31 09:00 dregad Relationship added related to 0025827
2019-06-03 03:12 dregad Changeset attached => MantisBT master 179ef093
2019-06-03 03:12 dregad Status assigned => resolved
2019-06-03 03:12 dregad Fixed in Version => 2.22.0