I would like to have a field, which value is based upon two other fields. Is it possible ?
For example:
on bug_report_page you can chose : immediacy (1,2,3,4) and impact/influence(1,2,3,4).
value of priority field (custom field) is calculated from matrix :
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
regards
custom field/function
Moderators: Developer, Contributor
Yes you can, at least with native fields. What you will need to do is to override the custom function that is used to verify issues before they are saved. In the overridden function you will calculate the field and update the value in the issue data.
The custom functions that you will need to override:
- custom_function_default_issue_create_validate().
- custom_function_default_issue_update_validate().
I am not sure if such function allows inspecting and changing the custom fields. If that is not possible, please submit an enhancement request so that such functionality is added.
Regards,
Victor
Mantis Blog
http://www.futureware.biz/
The custom functions that you will need to override:
- custom_function_default_issue_create_validate().
- custom_function_default_issue_update_validate().
I am not sure if such function allows inspecting and changing the custom fields. If that is not possible, please submit an enhancement request so that such functionality is added.
Regards,
Victor
Mantis Blog
http://www.futureware.biz/
I have done it with custom fields also
In my custom_functions_inc.php I have written this override function:
function custom_function_override_issue_create_notify( $p_issue_id ) {
$t_id = custom_field_get_id_from_name( 'Scadenza SLA' );
custom_field_set_value( $t_id, $p_issue_id, strtotime ('+5 day') );
}
To set a custom field to now+5 days on the creation of issue.
You should be able to handle your needs overriding the function:
function custom_function_default_issue_update_notify( $p_issue_id ) {
}
function custom_function_override_issue_create_notify( $p_issue_id ) {
$t_id = custom_field_get_id_from_name( 'Scadenza SLA' );
custom_field_set_value( $t_id, $p_issue_id, strtotime ('+5 day') );
}
To set a custom field to now+5 days on the creation of issue.
You should be able to handle your needs overriding the function:
function custom_function_default_issue_update_notify( $p_issue_id ) {
}