Hi,
I've noticed that Priority is sometimes updated automatically from the bug report depending on Severity & Reproductibility.
I wanted to know if there is a way to modify that behavior to fit a custom algorithm ?
I've searched a bit about that and found nothing about a such function in the code so i'm asking here.
Priority field behavior customization
Moderators: Developer, Contributor
Priority field behavior customization
MantisBT Version 2.8.0.209
PHP Version 7.0.24
MySQL Version 5.7.20
Running on Windows Server 2012 R2
PHP Version 7.0.24
MySQL Version 5.7.20
Running on Windows Server 2012 R2
Re: Priority field behavior customization
Nevermind,
I just found a solution, had to add something like this :
Just after all the gpc_get_int functions of all standard fields in bug_report.php, i bet it can be optimized but for my part i'm sticking with this as i'm not needed to have something safe for upgrades.
I just found a solution, had to add something like this :
Code: Select all
//Priority field behavior customization
if ( $t_bug_data->severity == 50)
{
if ( $t_bug_data->reproducibility == 100 ) { $t_bug_data->priority = 10; }
if ( $t_bug_data->reproducibility == 90 ) { $t_bug_data->priority = 10; }
if ( $t_bug_data->reproducibility == 70 ) { $t_bug_data->priority = 20; }
if ( $t_bug_data->reproducibility == 50 ) { $t_bug_data->priority = 20; }
if ( $t_bug_data->reproducibility == 30 ) { $t_bug_data->priority = 30; }
if ( $t_bug_data->reproducibility == 10 ) { $t_bug_data->priority = 30; }
}
if ( $t_bug_data->severity == 60)
{
if ( $t_bug_data->reproducibility == 100 ) { $t_bug_data->priority = 10; }
if ( $t_bug_data->reproducibility == 90 ) { $t_bug_data->priority = 20; }
if ( $t_bug_data->reproducibility == 70 ) { $t_bug_data->priority = 30; }
if ( $t_bug_data->reproducibility == 50 ) { $t_bug_data->priority = 40; }
if ( $t_bug_data->reproducibility == 30 ) { $t_bug_data->priority = 40; }
if ( $t_bug_data->reproducibility == 10 ) { $t_bug_data->priority = 40; }
}
if ( $t_bug_data->severity == 80)
{
if ( $t_bug_data->reproducibility == 100 ) { $t_bug_data->priority = 20; }
if ( $t_bug_data->reproducibility == 90 ) { $t_bug_data->priority = 30; }
if ( $t_bug_data->reproducibility == 70 ) { $t_bug_data->priority = 40; }
if ( $t_bug_data->reproducibility == 50 ) { $t_bug_data->priority = 40; }
if ( $t_bug_data->reproducibility == 30 ) { $t_bug_data->priority = 50; }
if ( $t_bug_data->reproducibility == 10 ) { $t_bug_data->priority = 60; }
}
MantisBT Version 2.8.0.209
PHP Version 7.0.24
MySQL Version 5.7.20
Running on Windows Server 2012 R2
PHP Version 7.0.24
MySQL Version 5.7.20
Running on Windows Server 2012 R2