Bug 470345 - Feature Request: add field to email headers that displays any set flags
Feature Request: add field to email headers that displays any set flags
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: Email Notifications (Show other bugs)
3.2
All Linux
medium Severity medium (vote)
: ---
: ---
Assigned To: David Lawrence
: FutureFeature, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-06 14:49 EST by Andy Gospodarek
Modified: 2014-06-29 19:00 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-24 23:28:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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 00:34 EST, 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 11:58 EDT, 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-24 23:27 EDT, David Lawrence
dkl: review+
Details | Diff

  None (edit)
Description Andy Gospodarek 2008-11-06 14:49:27 EST
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 00:34:19 EST
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 10:39:21 EST
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 02:39:48 EST
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 08:54:58 EST
Sweet.  Thanks!
Comment 5 David Lawrence 2009-06-19 11:34:31 EDT
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 11:58:06 EDT
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 06:24:57 EDT
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-24 23:27:37 EDT
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.