Page 1 of 2

Importing attachments

Posted: 26 Jan 2024, 22:23
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.

Re: Importing attachments

Posted: 27 Jan 2024, 16:16
by cas
Yes that can be done but you need to use a script to get this done.

Re: Importing attachments

Posted: 28 Jan 2024, 09:05
by atrol
The "Import/Export issues" plugins that comes out of the box with MantisBT supports attachments.

Re: Importing attachments

Posted: 28 Jan 2024, 09:26
by cas
Some more documentation (or a link to that) would come in handy :mrgreen:

Re: Importing attachments

Posted: 28 Jan 2024, 10:12
by atrol
Goto page Manage > Plugins
The mentioned plugin is listed in section "Available Plugins".

Re: Importing attachments

Posted: 29 Jan 2024, 09:39
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?

Re: Importing attachments

Posted: 29 Jan 2024, 19:06
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)?

Re: Importing attachments

Posted: 29 Jan 2024, 19:12
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

Re: Importing attachments

Posted: 29 Jan 2024, 20:37
by cas
I also requested a link to the docs to see how attachments can be handled. let's wait for that.

Re: Importing attachments

Posted: 29 Jan 2024, 20:59
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.

Re: Importing attachments

Posted: 29 Jan 2024, 21:12
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

Re: Importing attachments

Posted: 30 Jan 2024, 14:24
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?

Re: Importing attachments

Posted: 30 Jan 2024, 14:37
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

Re: Importing attachments

Posted: 30 Jan 2024, 14:40
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

Re: Importing attachments

Posted: 30 Jan 2024, 14:44
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/