Getting Status of the issue in subject line in emails

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
nastro
Posts: 3
Joined: 13 Sep 2006, 10:18

Getting Status of the issue in subject line in emails

Post 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.
Pro
Posts: 3
Joined: 05 Oct 2006, 19:15

Post by Pro »

I would be very interested in getting this working too. Does anyone know how to make this happen?
obriend
Posts: 6
Joined: 10 Nov 2005, 20:12

Post 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'];
Pro
Posts: 3
Joined: 05 Oct 2006, 19:15

Post 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".
clandriot
Posts: 8
Joined: 21 Jun 2006, 16:29
Location: Annecy, France

Post 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.
nastro
Posts: 3
Joined: 13 Sep 2006, 10:18

Post 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.
obriend
Posts: 6
Joined: 10 Nov 2005, 20:12

Post 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'];
Pro
Posts: 3
Joined: 05 Oct 2006, 19:15

Post by Pro »

That worked brilliantly! Thanks obriend!

--Pro
Post Reply