in Mantis v. 2.24.1 I'm trying to write a plugin for setting a value calculated automatically, based on the values of other fields or custom fields.
In my plugin there are following code:
Code: Select all
class MyPluginPlugin extends MantisPlugin {
function register() {
...
}
function hooks(){
return array(
'EVENT_MYPLUGIN_UPDATE' => 'update',
);
}
function events() {
return array(
'EVENT_MYPLUGIN_UPDATE' => EVENT_UPDATE_BUG,
);
}
function update( $p_issue_id, $p_bug_data, $p_bugnote_text ) {
$t_id = custom_field_get_id_from_name('<my_custom_field_name>');
custom_field_set_value( $t_id , $p_issue_id, <my_new_value>);
return $p_bug_data;
}
...
}
Why not?
Thanks all,
Cristian