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.
Getting Status of the issue in subject line in emails
Moderators: Developer, Contributor
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'];
# 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'];
You can find some hints in the columns_api.php
For example, for the status, you can use
You will find all other 'converter' in the above file.
For example, for the status, you can use
Code: Select all
get_enum_element( 'status', $p_status );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'];
#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'];