I need to update a custom_field (26) automatically after creating of an issue.
The data (name) is coming from a separate table 'DATA_table'.
I have created a new file 'custom_functions_inc.php' and located this file in the config folder.
Within the file i created an 'override' function, see below;
Code: Select all
function custom_function_override_issue_create_notify( $p_issue_id ) {
$t_custom_field = 26;
db_param_push();
$t_query = 'SELECT `c`.`name`
FROM {bug} AS b
JOIN `DATA_table` AS c ON `b`.`category_id` = `c`.`category_id`
WHERE `b`.`id` = ' . $p_issue_id . '';
$t_result = db_query( $t_query );
db_param_push();
$t_query2 = 'INSERT INTO {custom_field_string}
(`field_id`,`bug_id`,`value`)
VALUES
( ' . $t_custom_field . ',' . $p_issue_id . ',' . $t_result .')';
}
Thanks for helping....