I need a filter where I can bring the bugs from a specific project and a specific user, the current version allows me to filter by project and user who made the report in: filter_create_reported_by( $p_project_id, $p_user_id ); and filter by project and user who has assigned the bug in: filter_create_assigned_to_unresolved( $p_project_id, $p_user_id ); but there is no filter that joins me both functions where I can have from a project the bugs with users that report or have assigned,
I tried to create a custom filter with
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => $p_user_id );
$t_filter[FILTER_PROPERTY_REPORTER_ID] = array( '0' => $p_user_id );
But it brings me the bugs that the specific user has but where at the same time is informer and assigned.
I need your help please!! Thanks!
I need a filter where i can bring the bugs from a specific project and a specific user
Moderators: Developer, Contributor
Re: I need a filter where i can bring the bugs from a specific project and a specific user
did you check the advanced filter options? Click in the top right corner (of the view all bugs age) next to the chevron...
Re: I need a filter where i can bring the bugs from a specific project and a specific user
Hello good afternoon,
I did use that advanced filtering functionality but it does not solve my problem. The problem is that when the filter is made placing the same person as informant and at the same time as who has assigned the bug it shows me the cases that meet that restriction, I guess the query that is created for that filter comes with an AND in the database and I need is that it brings the bugs where the person appears as informant OR assigned.
The SQL query I need is the following:
SELECT id from mantis_bug_table where handler_id = (SELECT id from mantis_user_table where username = "username") or reporter_id = (SELECT id from mantis_user_table where username = "username")
"username" = is the user ID
I did use that advanced filtering functionality but it does not solve my problem. The problem is that when the filter is made placing the same person as informant and at the same time as who has assigned the bug it shows me the cases that meet that restriction, I guess the query that is created for that filter comes with an AND in the database and I need is that it brings the bugs where the person appears as informant OR assigned.
The SQL query I need is the following:
SELECT id from mantis_bug_table where handler_id = (SELECT id from mantis_user_table where username = "username") or reporter_id = (SELECT id from mantis_user_table where username = "username")
"username" = is the user ID
Re: I need a filter where i can bring the bugs from a specific project and a specific user
Umm, I don't understand what you are telling me. Can you please be more specific?
Re: I need a filter where i can bring the bugs from a specific project and a specific user
we are creating a function, not using the filters on the view
we are using the following variables:
$t_filter[FILTER_PROPERTY_REPORTER_ID] and $t_filter[FILTER_PROPERTY_HANDLER_ID]
I want to know which variable you are using in the "any condition".
we are using the following variables:
$t_filter[FILTER_PROPERTY_REPORTER_ID] and $t_filter[FILTER_PROPERTY_HANDLER_ID]
I want to know which variable you are using in the "any condition".
Re: I need a filter where i can bring the bugs from a specific project and a specific user
I thought you used it based on the question from cas
FILTER_PROPERTY_MATCH_TYPE to FILTER_MATCH_ANY
and
If it works the way you expect in UI, it should also work by setinng
FILTER_PROPERTY_MATCH_TYPE to FILTER_MATCH_ANY
Re: I need a filter where i can bring the bugs from a specific project and a specific user
Inside the function I created to list the bugs for a specific user (bugs assigned to that user or bugs where the user is the one reporting) and a specific project, I am using the following functions:
$t_filter = filter_get_default();
if( $p_user_id == 0 ) {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => META_FILTER_NONE );
} else {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => $p_user_id );
}
$t_filter[FILTER_PROPERTY_REPORTER_ID] = array( '0' => $p_user_id );
$t_filter[FILTER_PROPERTY_MATCH_TYPE] = array( '0' => FILTER_MATCH_ANY);
$t_bug_resolved_status_threshold = config_get( 'bug_resolved_status_threshold', null, $p_user_id, $p_project_id );
$t_filter[FILTER_PROPERTY_HIDE_STATUS] = array( '0' => $t_bug_resolved_status_threshold );
if( $p_project_id != ALL_PROJECTS ) {
$t_filter[FILTER_PROPERTY_PROJECT_ID] = array( '0' => $p_project_id );
}
return filter_ensure_valid_filter( $t_filter );
Is this correct?
$t_filter = filter_get_default();
if( $p_user_id == 0 ) {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => META_FILTER_NONE );
} else {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array( '0' => $p_user_id );
}
$t_filter[FILTER_PROPERTY_REPORTER_ID] = array( '0' => $p_user_id );
$t_filter[FILTER_PROPERTY_MATCH_TYPE] = array( '0' => FILTER_MATCH_ANY);
$t_bug_resolved_status_threshold = config_get( 'bug_resolved_status_threshold', null, $p_user_id, $p_project_id );
$t_filter[FILTER_PROPERTY_HIDE_STATUS] = array( '0' => $t_bug_resolved_status_threshold );
if( $p_project_id != ALL_PROJECTS ) {
$t_filter[FILTER_PROPERTY_PROJECT_ID] = array( '0' => $p_project_id );
}
return filter_ensure_valid_filter( $t_filter );
Is this correct?