Page 1 of 1

Getting Status of the issue in subject line in emails

Posted: 13 Sep 2006, 10:23
by nastro
Hi,

Can anybody let me know how to add status of the bug in the subject line in the emails?

I tried modifying in email_api file in core folder but in vain.

Please let me know if anyone has any idea.

Posted: 05 Oct 2006, 19:17
by Pro
I would be very interested in getting this working too. Does anyone know how to make this happen?

Posted: 05 Oct 2006, 21:01
by obriend
You are looking in the correct file to make the edit. In function email_bug_info_to_one_user() change the following line:

# build subject
$t_subject = '['.$p_visible_bug_data['email_project'].' '.bug_format_id( $p_visible_bug_data['email_bug'] ).']: '.$p_visible_bug_data['email_summary'];

to

$t_subject = '['.$p_visible_bug_data['email_project'].' '.bug_format_id( $p_visible_bug_data['email_bug'] ).']: '.'('.$p_visible_bug_data['email_status'].'): '.$p_visible_bug_data['email_summary'];

Posted: 05 Oct 2006, 21:34
by Pro
That's a good start. Now, how do I convert the numerical value of the status to a text value. With this change, I get codes such as (50) instead of "assigned" and (80) instead of "resolved".

Posted: 06 Oct 2006, 06:20
by clandriot
You can find some hints in the columns_api.php
For example, for the status, you can use

Code: Select all

get_enum_element( 'status', $p_status );
You will find all other 'converter' in the above file.

Posted: 06 Oct 2006, 12:02
by nastro
Thanks Obriend! Yes it did work.

Regarding getting the string equivalent of the interger I used "Case statements" to solve. Pro you could write back if further clarifications are required.

Posted: 06 Oct 2006, 14:07
by obriend
Sorry, I forgot the line to convert the id to its text value. When I went looking to get that line for you I discoverd my logic to convert to text and concat it with the email subject was slightly flawed. I made some changes to my code and you should do the same. Your code should now look like this in function email_bug_info_to_one_user():

#This will convert the ID into its text value.
$t_status = get_enum_element( 'status', $p_visible_bug_data['email_status'] );

#This will concat the email subject with the status value
$t_subject = '['.$p_visible_bug_data['email_project'].' '.bug_format_id( $p_visible_bug_data['email_bug'] ).']: '.'('.$t_status.'): '.$p_visible_bug_data['email_summary'];

Posted: 06 Oct 2006, 18:20
by Pro
That worked brilliantly! Thanks obriend!

--Pro