Bug 470345 - Feature Request: add field to email headers that displays any set flags
Summary: Feature Request: add field to email headers that displays any set flags
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Email Notifications
Version: 3.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-06 19:49 UTC by Andy Gospodarek
Modified: 2014-06-29 23:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-25 03:28:11 UTC
Embargoed:


Attachments (Terms of Use)
v1 of patch to add flags to the mail headers of bug mail notifications (2.39 KB, patch)
2008-11-07 05:34 UTC, Noura El hawary
dkl: review+
Details | Diff
Patch to add flag requestees to the mail headers of bug mail notifications (v1) (592 bytes, patch)
2009-06-19 15:58 UTC, David Lawrence
nelhawar: review+
Details | Diff
Patch to add flag requestees to the mail headers of bug mail notifications (v2) (599 bytes, patch)
2009-06-25 03:27 UTC, David Lawrence
dkl: review+
Details | Diff

Description Andy Gospodarek 2008-11-06 19:49:27 UTC
Description of problem:

Bugzilla notification email already contain a list of headers that contain information about a bugs status.  For example these:

X-Bugzilla-Reason:
X-Bugzilla-Type:
X-Bugzilla-Watch-Reason:
X-Bugzilla-Classification:
X-Bugzilla-Product:
X-Bugzilla-Version:
X-Bugzilla-Component:
X-Bugzilla-Keywords:
X-Bugzilla-Severity:
X-Bugzilla-Comment:
X-Bugzilla-Who:
X-Bugzilla-Status:
X-Bugzilla-Priority:
X-Bugzilla-Assigned-To:
X-Bugzilla-Target-Milestone:
X-Bugzilla-Changed-Fields:

It would be great if there was a field for 

X-Bugzilla-Flags:

or something similar and if any flags are set (devel_ack, exception, pm_ack, etc.) they would be listed in the email headers.

Comment 1 Noura El hawary 2008-11-07 05:34:19 UTC
Created attachment 322815 [details]
v1 of patch to add flags to the mail headers of bug mail notifications

Hi Dave,

Attached is a patch that would add the Flags of the bug to the mail headers of the bug's email notifications, the patch is on bz-web2-test for testing i have made some tests and you can see the email examples in the data/mailer.testfile file in the bz-web2 server.

Noura

Comment 2 David Lawrence 2008-11-07 15:39:21 UTC
Comment on attachment 322815 [details]
v1 of patch to add flags to the mail headers of bug mail notifications

>Index: Bugzilla/BugMail.pm
>+    # REDHAT EXTENSION START 470345
>+    my $bug_flags = Bugzilla::Flag->match({ 'bug_id'      => $id,
>+                                            'target_type' => 'bug' });
>+    my @visible_flags;
>+    for my $f (@$bug_flags){
>+        my $f_type = Bugzilla::FlagType->new({ name => $f->name });
>+        if (defined $f_type && $user->can_see_flag($f_type)) {
>+            push(@visible_flags, $f->name . $f->status);
>+        }
>+    }
>+    # REDHAT EXTENSION END 470345

Nit-Pick: You can shorten this some by doing the following way:

    my @visible_flags;
    for my $f (@$bug_flags){
        if (defined $f->type && $user->can_see_flag($f->type)) {
            push(@visible_flags, $f->name . $f->status);
        }
    }

Looks good Noura.

Dave

Comment 3 Noura El hawary 2008-11-10 07:39:48 UTC
Thanks for the review Dave, committed to cvs after applying your suggestion.

Andy the feature should be live in the next release which is usually on Thursdays.


Noura

Comment 4 Andy Gospodarek 2008-11-10 13:54:58 UTC
Sweet.  Thanks!

Comment 5 David Lawrence 2009-06-19 15:34:31 UTC
Reopening as we should extend this to also include the requestee if one is set for a particular flag.

Comment 6 David Lawrence 2009-06-19 15:58:06 UTC
Created attachment 348679 [details]
Patch to add flag requestees to the mail headers of bug mail notifications (v1)

Comment 7 Noura El hawary 2009-06-24 10:24:57 UTC
Comment on attachment 348679 [details]
Patch to add flag requestees to the mail headers of bug mail notifications (v1)

hey Dave,

Patch looks good and works fine.

Thanks,
Noura

Comment 8 David Lawrence 2009-06-25 03:27:37 UTC
Created attachment 349328 [details]
Patch to add flag requestees to the mail headers of bug mail notifications (v2)

Found an issue where $f->requestee is a user object and so instead I needed to be using the value for $f->requestee->login for the flag text to be added to the email header. Committed to SVN and will be in the next Bugzilla update.

Dave


Note You need to log in before you can comment on or make changes to this bug.