Closed Bug 365735 Opened 19 years ago Closed 18 years ago

Add classification, alias, assigned to name, reporter login and reporter name fields to BugMail

Categories

(Bugzilla :: Email Notifications, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: altlist, Assigned: altlist)

References

Details

Attachments

(1 file, 3 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1 Build Identifier: I'd like to request there be more fields/values for the BugMail template (classification, reporter, reporter name, owner, and ownername). Reproducible: Always
Attached patch v1 (obsolete) — Splinter Review
Attachment #250246 - Flags: review?(LpSolit)
Comment on attachment 250246 [details] [diff] [review] v1 "Owner" already exists as "Assigned-To". Also, if you're going to add these fields, you should add X-Bugzilla headers for them to the template. Also, the way you do reportername is incorrect--it should be "new Bugzilla::User({ name => $values{reporter}})" to instantiate the object. Also, this object should already be available through the bug object, but maybe we don't have a bug object available at this point?
Attachment #250246 - Flags: review?(LpSolit) → review-
Also, we have to decide if we want to just keep adding headers to bugmail, or if there's some reason to limit it.
Target Milestone: --- → Bugzilla 3.2
Do we need to keep adding headers? I can see perhaps classification and reporter, but not much else. My main interest is to add more info in the email message itself.
Attached patch v2 (obsolete) — Splinter Review
Updated patch to include X-Bugzilla header for classification. But I did not add the other ones, as I don't think they're necessary. Also cleaned up the Bugzilla::User calls.
Attachment #250246 - Attachment is obsolete: true
Attachment #251229 - Flags: review?
Attachment #251229 - Flags: review? → review?(mkanat)
Comment on attachment 251229 [details] [diff] [review] v2 I think Wicked is a better reviewer for this.
Attachment #251229 - Flags: review?(mkanat) → review?(wicked+bz)
In the future we should look into generic settings for these. Something like that the one suggested in bug 86201. Or perhaps give email templates objects that they can use to retrieve all info they ever want to add into emails.
Assignee: email-notifications → altlist
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: request more fields in BugMail (classification, reporter, and owner) → Add classification, alias, assigned to name, reporter login and reporter name fields to BugMail
Comment on attachment 251229 [details] [diff] [review] v2 These additions seem to work as expected. Alias can be blank if it's not defined but that's the way some other fields work too so it's fine. Also, I'm not entirely sure we should add classification field when they are disabled. Looks like they will always be Unclassified so maybe that's not too bad.
Attachment #251229 - Flags: review?(wicked) → review+
Flags: approval?
Just somebody make sure before you check this in that "alias" isn't actually *undefined* if usebugaliases is off.
Status: NEW → ASSIGNED
Flags: approval? → approval+
Comment on attachment 251229 [details] [diff] [review] v2 >+ assignedtoname => new Bugzilla::User({ name => $values{'assigned_to'}})->name, IIRC, this syntax is incorrect. You must write Bugzilla::User->new()->name.
(In reply to comment #10) > >+ assignedtoname => new Bugzilla::User({ name => $values{'assigned_to'}})->name, > IIRC, this syntax is incorrect. You must write Bugzilla::User->new()->name. It works in my tests and that's what mkanat suggested in comment #2. So, what is it, mkanat?
It's ambiguous, but it will work. LpSolit's syntax is more reliable as far as compatibility with future versions of Perl (or future modifications of that line of code). It should work either way, but feel free to make LpSolit's change on checkin.
(In reply to comment #9) > Just somebody make sure before you check this in that "alias" isn't actually > *undefined* if usebugaliases is off. Why? If we don't use aliases, I expect it to be blank. Or do you mean blank vs undefined?
(In reply to comment #13) > Why? If we don't use aliases, I expect it to be blank. Or do you mean blank vs > undefined? Right, I mean undef.
In this case, I will wait for the reviewer to check this before committing the patch.
Comment on attachment 251229 [details] [diff] [review] v2 I just tested this patch to work with both LpSolit's change to object construction and with disabled aliases and classifications. Even when these fields are disabled, their current value is given to the email template. This works because even though aliases or classifications are disabled in params they are considered editable fields by the Bug object. Specifically, any field of bugs table is editable except custom fields that have been obsoleted. So my r+ still stands.
Isn't it a problem? If aliases and classifications are turned off, I would expect to see "" instead of their real value. After all, they are unusable and trying to use them in Bugzilla will fail, especially the alias. We are not very consistent.
Clearing the approval flag till my question in comment 17 is addressed and till the patch is updated per my comment 10.
Flags: approval+ → approval?
Attached patch v3 (obsolete) — Splinter Review
Updated patch to use the updated construction method and conditionals.
Attachment #251229 - Attachment is obsolete: true
Attachment #274550 - Flags: review?(wicked)
Re-request approval when v3 is reviewed.
Flags: approval?
Attachment #274550 - Attachment is patch: true
Comment on attachment 274550 [details] [diff] [review] v3 >--- Bugzilla/BugMail.pm 2004-05-26 00:21:43.000000000 -0700 >+ assignedtoname => new Bugzilla::User->new({ name => $values{'assigned_to'}})->name, Remove the first new before checkin. >+ reportername => new Bugzilla::User->new({ name => $values{'reporter'}})->name, Same here.
Attachment #274550 - Flags: review?(wicked) → review+
Flags: approval?
Flags: approval? → approval+
Comment on attachment 274550 [details] [diff] [review] v3 >+ my $classification = new Bugzilla::Classification($product->classification_id); Where do you |use Bugzilla::Classification|? The only reason BugMail.pm doesn't crash is because Bugzilla::User uses it, which is a dangerous assumption. I will attach an updated patch which also fixes the incorrect usage of 'new'.
Attachment #274550 - Flags: review-
Attached patch patch, v3.1Splinter Review
Add use Bugzilla::Classification.
Attachment #274550 - Attachment is obsolete: true
Attachment #278283 - Flags: review+
Checking in Bugzilla/BugMail.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v <-- BugMail.pm new revision: 1.109; previous revision: 1.108 done Checking in template/en/default/email/newchangedmail.txt.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/email/newchangedmail.txt.tmpl,v <-- newchangedmail.txt.tmpl new revision: 1.10; previous revision: 1.9 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Blocks: 449184
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: