Page 1 of 1

Priority field behavior customization

Posted: 03 Oct 2019, 13:32
by Asura
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.

Re: Priority field behavior customization

Posted: 14 Oct 2019, 14:21
by Asura
Nevermind,

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; }
}
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.