Auto-fill ticket details via link

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
acoder2020
Posts: 106
Joined: 11 Jan 2024, 19:32

Auto-fill ticket details via link

Post by acoder2020 »

With our old system (TRAC) I could create a link in our app that users click -this would auto populate some of the basic fields in the ticket create page. Very helpful for streamlining support requests for different common tasks.

Is there a way to auto-populate fields in bug_report_page.php via URL query, for example:

https://mantis.example.com/bug_report_p ... ary=Delete record&category=Color Charts&priority=low&severity=minor
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Auto-fill ticket details via link

Post by atrol »

That's possible, e.g.

Code: Select all

https://mantisbt.org/bugs/bug_report_page.php?severity=30&priority=40
Check bug_report.page_php for the names of the parameters, esepcially this is the interesting part

Code: Select all

	$f_build				= gpc_get_string( 'build', '' );
	$f_platform				= gpc_get_string( 'platform', '' );
	$f_os					= gpc_get_string( 'os', '' );
	$f_os_build				= gpc_get_string( 'os_build', '' );
	$f_product_version		= gpc_get_string( 'product_version', '' );
	$f_target_version		= gpc_get_string( 'target_version', '' );
	$f_profile_id			= gpc_get_int( 'profile_id', 0 );
	$f_handler_id			= gpc_get_int( 'handler_id', 0 );

	$f_category_id			= gpc_get_int( 'category_id', 0 );
	$f_reproducibility		= gpc_get_int( 'reproducibility', (int)config_get( 'default_bug_reproducibility' ) );
	$f_eta					= gpc_get_int( 'eta', (int)config_get( 'default_bug_eta' ) );
	$f_severity				= gpc_get_int( 'severity', (int)config_get( 'default_bug_severity' ) );
	$f_priority				= gpc_get_int( 'priority', (int)config_get( 'default_bug_priority' ) );
	$f_summary				= gpc_get_string( 'summary', '' );
	$f_description			= gpc_get_string( 'description', config_get( 'default_bug_description' ) );
	$f_steps_to_reproduce	= gpc_get_string( 'steps_to_reproduce', config_get( 'default_bug_steps_to_reproduce' ) );
	$f_additional_info		= gpc_get_string( 'additional_info', config_get( 'default_bug_additional_info' ) );
	$f_view_state			= gpc_get_int( 'view_state', (int)config_get( 'default_bug_view_status' ) );
	$f_due_date				= gpc_get_string( 'due_date', date_strtotime( config_get( 'due_date_default' ) ) );
Please use Search before posting and read the Manual
acoder2020
Posts: 106
Joined: 11 Jan 2024, 19:32

Re: Auto-fill ticket details via link

Post by acoder2020 »

Is it possible to also set Project? Some users have 2 possible projects.
atrol
Site Admin
Posts: 8555
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Auto-fill ticket details via link

Post by atrol »

Code: Select all

	$t_project_id = gpc_get_int( 'project_id', $t_current_project );
Please use Search before posting and read the Manual
Post Reply