Importing attachments

Get help from other users here.

Moderators: Developer, Contributor

acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Importing attachments

Post by acoder2020 »

Is it possible to import attachments along with existing data from another issue tracker (via CSV import tool)?

Losing attachments from our 15 years of data will be a barrier. Probably should have thought to ask this before but I was in the weeds with figuring out to get basic ticket data imported.
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: Importing attachments

Post by cas »

Yes that can be done but you need to use a script to get this done.
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Importing attachments

Post by atrol »

The "Import/Export issues" plugins that comes out of the box with MantisBT supports attachments.
Please use Search before posting and read the Manual
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: Importing attachments

Post by cas »

Some more documentation (or a link to that) would come in handy :mrgreen:
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Importing attachments

Post by atrol »

Goto page Manage > Plugins
The mentioned plugin is listed in section "Available Plugins".
Please use Search before posting and read the Manual
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: Importing attachments

Post by cas »

Is there also a description of how the plugin works (there is no accompanying document with the plaugin itself) and how to construct the XML such that they are ready for the import?
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Importing attachments

Post by acoder2020 »

cas wrote: 27 Jan 2024, 16:16 Yes that can be done but you need to use a script to get this done.
I'm looking into doing this myself. The CSV import plugin does not handle attachments - just ticket data and users.

Is there an API I could use to get a new MantisBT ticket identifier, so I could somehow link the newly created MantisBT ticket with a separate stack of attachments (which do not have any knowledge of MantisBT)?
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Importing attachments

Post by acoder2020 »

atrol wrote: 28 Jan 2024, 09:05 The "Import/Export issues" plugins that comes out of the box with MantisBT supports attachments.
I can't find documentation to support this. The installed plugin section does not link to any docs, and there isn't any info on what the file would look like.

Image

Image

Image
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: Importing attachments

Post by cas »

I also requested a link to the docs to see how attachments can be handled. let's wait for that.
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Importing attachments

Post by acoder2020 »

Even in the best case scenario I don't see how more than one attachment per ticket could be done. About half of our tickets with attachments have more than 2 attachments.

Agree, will wait for more enlightenment.
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Importing attachments

Post by atrol »

@cas I am not aware that there is an up to date end user documentation, but the original design document (wow, it was written in 2008, the year when I started using MantisBT) should help to understand the concept https://www.mantisbt.org/wiki/doku.php/ ... portexport

Concerning the XML format: There is a DTD in the root folder of the plugin.
Unfortunately it was not updated when attachments wew added  https://www.mantisbt.org/bugs/view.php?id=12013
but it should not be a big deal, as the source code for export/import is not that hard to understand.
Export an issue with a small attachment. I guess you will understand how it works.

@acoder2020 you might also be interested in the MantisBT REST API as one more option how to create issues, see
https://www.mantisbt.org/docs/master/en ... p/#restapi

Not recommend, but the very last chance to get it done: Direct access to the database, see the ERD https://www.mantisbt.org/docs/master/en ... tabase.erd
Please use Search before posting and read the Manual
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Importing attachments

Post by acoder2020 »

atrol wrote: 29 Jan 2024, 21:12Concerning the XML format: There is a DTD in the root folder of the plugin.
Unfortunately it was not updated when attachments wew added  https://www.mantisbt.org/bugs/view.php?id=12013
but it should not be a big deal, as the source code for export/import is not that hard to understand.
Export an issue with a small attachment. I guess you will understand how it works.
How big of a mountain would it be to ask to have that documentation either updated or expanded? Would that be a "bug" request of some kind?
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Importing attachments

Post by acoder2020 »

Linking to another thread where someone was apparently able to import an attachment with XML, but they did not provide an example XML file: viewtopic.php?t=24805
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Importing attachments

Post by acoder2020 »

Wait, where is the XMLImportExport plugin located? It's not listed on the official plugins page:

https://www.mantisbt.org/wiki/doku.php/ ... gins:start
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Importing attachments

Post by acoder2020 »

atrol wrote: 29 Jan 2024, 21:12 @acoder2020 you might also be interested in the MantisBT REST API as one more option how to create issues, see
https://www.mantisbt.org/docs/master/en ... p/#restapi
The documentation for setting up and using REST api in mantis is thin, but I found this guide which helps explain it for everyday end users:

https://www.testingdocs.com/mantisbt-rest-api-guide/
Post Reply