View Issue Details

IDProjectCategoryView StatusLast Update
0004987mantisbtcustomizationpublic2008-07-14 16:43
ReporterCasNuy Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status feedbackResolutionopen 
Product Version0.19.1 
Summary0004987: Added export functionality into other Mantis instance
Description

We use Mantis as our helpdesk system on a few locations, all separate installations. In some cases an issue should be moved form one installation to another, ie from one database to the other.
I have created all scripts for this functionality and obviously do not mind to make this available to the group.
During the coding i tried to stay in line with the coding conventions, so if it would be something to add to the next release, it could be fitted in easily.

If people are interested, let me know and i will create a small distro.

Cas

Additional Information

Files affected
ext_db_add.php New
ext_db_delete.php New
ext_db_edit.php New
ext_db_update.php New
ext_db_verify.php New
manage_ext_db_page.php New
bug_actiongroup.php Modified
bug_actiongroup_page.php Modified
custom_strings_inc.php Modified
4 Export bug functionality
core/html_api.php Modified
function print_manage_menu()
core/print_api.php Modified
function print_export_option_list()
function print_all_bug_action_option_list()
core/bug_api.php Modified
function bug_export()

Required setting(s) within config_inc.php :
$g_mantis_bug_export_table = $g_db_table_prefix.'_bug_export_table';
$g_export_bug_threshold = DEVELOPER;
$g_manage_ext_db_threshold = MANAGER;
$g_export_bug_project = 1 ;
$g_export_bug_category = Other ;
$g_export_bug_status = 20 ;

SQL
CREATE TABLE mantis_bug_export_table (
export_id int(7) unsigned NOT NULL auto_increment,
ext_unit varchar(32) NOT NULL default '',
mantis_link varchar(128) NOT NULL default '',
ext_host varchar(64) NOT NULL default '',
ext_db varchar(64) NOT NULL default '',
ext_user varchar(25) NOT NULL default '',
ext_pw varchar(128) NOT NULL default '',
ext_pref varchar(16) NOT NULL default '',
ext_mail varchar(64) NOT NULL default '',
ext_project smallint(7) NOT NULL default '0',
ext_category varchar(64) NOT NULL default '',
PRIMARY KEY (copy_id),
KEY ext_db (ext_unit)
) TYPE=MyISAM ;

TagsNo tags attached.

Relationships

child of 0004937 closedvboctor Mantis 1.0.0a1 Release 

Activities

jlatour

jlatour

2004-12-16 08:42

reporter   ~0008657

Sounds interesting. I can venture a guess, but could you explain how it works?

CasNuy

CasNuy

2004-12-16 11:35

reporter   ~0008664

The table will hold information on the various Mantis instances, including information on Category & project to move incoming issues into.
One of the bug-actions will be "export". When selecting this option, a screen will be presented to choose the target instance (if enough authorisation exists). Clicking OK will copy the bug to the other instance (including a ref to the oriiginal), the local bug is set to Feedback, a note added that it has been transferred. Receiving party will aslo receive a separte e-mail of this activity.

maintenance of the table is only allowed for Administrators. There is an option available to verify the connection to the other instance.

Hopefully the above makes sense ?

Cas

jlatour

jlatour

2004-12-16 11:59

reporter   ~0008665

But how does it export?

CasNuy

CasNuy

2004-12-16 17:15

reporter   ~0008677

It connects to the remote db and adds the issue there using, for now, direct sql statement into bug_table, bug_history_table,bug_text_table.

jlatour

jlatour

2004-12-16 17:25

reporter   ~0008678

It would be nice if you could do this with some sort of RPC, so you don't need direct access to the database (and nothing messes up if you have different versions).

CasNuy

CasNuy

2004-12-17 14:23

reporter   ~0008707

Not sure if I agree, with your suggestion, i could even add to other instances without them having these scripts, versions are hardly an issue since I am exporting essentials only.
On top of that, i am also not sure how to trigger such a rpc.

jlatour

jlatour

2004-12-17 14:51

reporter   ~0008710

Well, the scripts would be added to the distribution, so any Mantis released after the scripts have been included should be usable.

The advantage of this approach is that you won't mess anything up if the database structure changes, nor will you need direct access to the other MySQL server.

CasNuy

CasNuy

2004-12-17 15:11

reporter   ~0008712

Point taken, will try to add rpc mode.

vboctor

vboctor

2005-05-18 09:36

manager   ~0010166

MantisConnect is a webservice developed in PHP and runs on top of Mantis. It can be used to submit an issue to a remote Mantis installation. It can also be used to submit notes. Attachments are partially supported, and history is not supported yet.

MantisConnect also allows retrieving the projects and categories within these projects.

See http://www.futureware.biz/mantisconnect for more details. A lot of the above features are part of the next version of MantisConnect which is expected to release with Mantis 1.0.0a3.

Following are issues with copying or moving issues from one Mantis instance to another:

  • References to other issue ids that are embedded in the description / notes.
  • References to notes that are embedded in the description / notes.
  • Issue relationships
  • Sponsorships (I assume in such installations, this feature is disabled anyway).
  • The ids of the users that are stored in the issue history.
  • The reporter / handler user ids.
  • The status of the issue (assuming that the status enumeration can be different).
CasNuy

CasNuy

2005-05-22 06:20

reporter   ~0010190

First impression is that this would not fit my purpose plus it means a lot of work to get it set up. I also do not like the dependancy on dot.net but that is a personal view. I want to be able to use a mashed network of Mantis installations which my dev does. It is fairly basic and that's why i hoped it would become an integral part of Mantis opposite a seperate development. Jeroen's suggestion to avoid direct access to the database is omething which i subscribe but I have not been able to really work on that, any suggestions are welcome.

If i understand correctly, this is not on the list to become part of Mantis so I will have to keep my code up to date so it keeps on working with future versions of Mantis.
Unfortunately i have some more customised functionality (like Due dates) so i need to review the code anyway with every new release.

I will make the updated code available through my website at www.nuy.info

vboctor

vboctor

2008-07-13 15:48

manager   ~0018463

Would be cool if you make this available as a Mantis plugin using the 1.2.0 plugin support feature.

I've implemented the same feature sometime ago. I did this via MantisConnect (which is a PHP webservice, hence, no dependency on .NET). The idea is that the Mantis instances could be hosted on totally different servers. This code is packaged with MantisConnect as an example of consuming the webservice from a PHP client.

cas

cas

2008-07-14 16:43

reporter   ~0018515

Last edited: 2008-07-15 02:50

Well, I am working on this plugin so it will become available again.
Should be ready before 1.2.0 hits the market.

Issue History

Date Modified Username Field Change
2004-12-15 12:17 CasNuy New Issue
2004-12-16 08:41 jlatour Relationship added child of 0004937
2004-12-16 08:42 jlatour Note Added: 0008657
2004-12-16 08:42 jlatour Status new => feedback
2004-12-16 11:35 CasNuy Note Added: 0008664
2004-12-16 11:59 jlatour Note Added: 0008665
2004-12-16 17:15 CasNuy Note Added: 0008677
2004-12-16 17:25 jlatour Note Added: 0008678
2004-12-17 14:23 CasNuy Note Added: 0008707
2004-12-17 14:51 jlatour Note Added: 0008710
2004-12-17 15:11 CasNuy Note Added: 0008712
2005-05-18 09:36 vboctor Note Added: 0010166
2005-05-22 06:20 CasNuy Note Added: 0010190
2008-07-13 15:48 vboctor Note Added: 0018463
2008-07-14 16:43 cas Note Added: 0018515
2008-07-15 02:50 cas Note Edited: 0018515