custom field/function

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
kmet
Posts: 13
Joined: 13 Apr 2005, 10:37

custom field/function

Post by kmet »

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
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

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/
MTW
Posts: 13
Joined: 02 Sep 2005, 08:44
Contact:

I have done it with custom fields also

Post by MTW »

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 ) {
}
Post Reply