attachment import

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Kugelfisch
Posts: 2
Joined: 15 Oct 2009, 06:15

attachment import

Post by Kugelfisch »

Hello,

i'm currently developing a converter from Rational Clearquest to Mantis for my Company.
I've managed to get everything to work (bugs are imported with correct date desc and so on) except the attachments.

The ImportXML Plugin has been rewritten for this purpose.
So currently the bug is created with the data from the .xml file and I get the path to the attachment.

Now my Problem:
To make it short, I can't upload the attachment because the function file_add() expects an array.
I currently only have the bug ID and the Path to the attachment.
Is there a way to create the necessary information expected by file_add() with these informations?

regards,

Haynes
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Re: attachment import

Post by vboctor »

The easiest way would be to setup MantisBT to use DISK for attachment storage.

Here are the steps I recommend:

1. Setup MantisBT to use DISK attachments.
2. Place the attachment in the appropriate upload path for the project.
3. Insert a record into the DB that refers to the file (see the last 10 lines of core/file_api.php file_add() function).
4. Insert the history record if required and touch up the bug last updated time. [optional]
Migrate your MantisBT to the MantisHub Cloud
Kugelfisch
Posts: 2
Joined: 15 Oct 2009, 06:15

Re: attachment import

Post by Kugelfisch »

Thanks for the quick reply vboctor :)

I managed to import an attachment :)
It still needs some tuning to import all attachments, but it's a start.

The only "problem" I have now is a cosmetical thing. Scince I can't use the $_FILES variable I currently can't get the filetype of the file.
I'm currently using the php function filetype() but it only returns "file" as a value.
Any ideas how to solve this?
jsiegel5
Posts: 3
Joined: 01 Apr 2010, 02:02

Re: attachment import

Post by jsiegel5 »

Hi Kugelfisch,
Any chance you could share your Clearquest -> Mantis converter? I need to do the same thing.
Regards,
Jeff
swapna

Clearquest to Mantis BT Migration

Post by swapna »

Hi,

I am looking for a clearquest to mantis Bt migration. Please any one the process of this migration please share..
I am pretty new to Mantis.

I have installed the Mantis 1.2.8 and Mysql.

Thanks in advance!
Post Reply