View Issue Details

IDProjectCategoryView StatusLast Update
0016117mantisbtplug-inspublic2014-01-01 22:13
Reporterkydow Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Summary0016117: XML Import never update my issues but create new one
Description

Hello,

I'm using the XML Import/Export plugin.
The Extract works well, but i don't understand why when i import an issue (with an specific id, for ex : <id>10</id>) Mantis don't update this existing issue and create a new one.

I would like to make some update whith XML Import and not just create new one. Is it possible ?
I saw that the function update() exist in the file : mantis/www/core/bug_api.php
but it's doesn't call in in the file : mantis/www/plugins/XmlImportExport/ImportXml/Issue.php

I would like to Import with an XML file a new issue (create) when the <id> is set to 0 and update an issue with an specific <id>.

Tagspatch
Attached Files
exported_issues.xml (3,484 bytes)   
<?xml version="1.0" encoding="UTF-8"?>
<mantis version="1.3.0dev" urlbase="http://mantis.intraced.clb/mantis/" issuelink="#" notelink="~" format="1">
    <issue>
        <id>20</id>
        <project id="1">TEST</project>
        <reporter id="3">user1</reporter>
        <priority id="30">normale</priority>
        <severity id="50">mineur</severity>
        <reproducibility id="70">n'a pas essayé</reproducibility>
        <status id="10">nouveau</status>
        <resolution id="10">ouvert</resolution>
        <projection id="10">aucun</projection>
        <category id="2">NIIM</category>
        <date_submitted>1372316606</date_submitted>
        <last_updated>1372316606</last_updated>
        <eta id="10">aucun</eta>
        <view_state id="10">public</view_state>
        <summary>Issue to modify</summary>
        <due_date>1</due_date>
        <description>Essai échange client</description>
        <additional_information>Pour échange client, et autres&#13;
</additional_information>
        <custom_fields>
            <custom_field>
                <id>1</id>
                <name>Phase</name>
                <type>3</type>
                <value>Client</value>
                <access_level_r>10</access_level_r>
            </custom_field>
        </custom_fields>
        <bugnotes>
            <bugnote>
                <id>6</id>
                <reporter id="3">user</reporter>
                <note>essai de note</note>
                <view_state id="10">public</view_state>
                <date_submitted>1372316606</date_submitted>
                <last_modified>1372316606</last_modified>
                <note_type>0</note_type>
                <note_attr>0</note_attr>
                <time_tracking>0</time_tracking>
            </bugnote>
        </bugnotes>
    </issue>
	    <issue>
        <id>0</id>
        <project id="1">TEST</project>
        <reporter id="3">user1</reporter>
        <priority id="30">normale</priority>
        <severity id="50">mineur</severity>
        <reproducibility id="70">n'a pas essayé</reproducibility>
        <status id="10">nouveau</status>
        <resolution id="10">ouvert</resolution>
        <projection id="10">aucun</projection>
        <category id="2">NIIM</category>
        <date_submitted>1372316606</date_submitted>
        <last_updated>1372316606</last_updated>
        <eta id="10">aucun</eta>
        <view_state id="10">public</view_state>
        <summary>New issue to import</summary>
        <due_date>1</due_date>
        <description>New issue to import</description>
        <additional_information>Pour échange client, et autres&#13;
</additional_information>
        <custom_fields>
            <custom_field>
                <id>1</id>
                <name>Phase</name>
                <type>3</type>
                <value>Client</value>
                <access_level_r>10</access_level_r>
            </custom_field>
        </custom_fields>
        <bugnotes>
            <bugnote>
                <id>6</id>
                <reporter id="3">user</reporter>
                <note>essai de note</note>
                <view_state id="10">public</view_state>
                <date_submitted>1372316606</date_submitted>
                <last_modified>1372316606</last_modified>
                <note_type>0</note_type>
                <note_attr>0</note_attr>
                <time_tracking>0</time_tracking>
            </bugnote>
        </bugnotes>
    </issue>
</mantis>
exported_issues.xml (3,484 bytes)   
PatchXmlImportExport.zip (89,832 bytes)

Relationships

related to 0012013 closeddregad Improvements for plugin ImportExportXml (and required core changes) 

Activities

dregad

dregad

2013-06-27 11:51

developer   ~0037323

This plugin has been significantly improved in 1.3.x branch. Would you have the possibility to upgrade a test environment using a nightly build from the master branch and check if this issue is resolved?

Note that i am not recommending you use 1.3 in production.

kydow

kydow

2013-06-27 12:00

reporter   ~0037324

Last edited: 2013-06-27 12:08

Hello,
Thanks for the quick answer

I'm already using Mantis 1.3.0dev
with the schema version 183

And i already use the XmlImportExport_v2.zip patch of the mantisBT id : 0012013

dregad

dregad

2013-06-27 14:28

developer   ~0037325

Didn't realize there had been additional patches/fixes after dhx had committed dominik's enhancements... never a good idea to add comments/further fixes to an already resolved issue.

I don't have the bandwidth to work on this atm, but if you can submit a patch or even better a pull request, i would review it

kydow

kydow

2013-06-28 05:12

reporter   ~0037330

I've installed mantis 1.3.0dev. I applied the patch XmlImportExport_1.3.x.patch, but i have the same problem whith updating an existing issue.

I post a note in the mantisBT id : 0012013

Thanks.

dregad

dregad

2013-06-28 10:07

developer   ~0037335

I did not ask you to post a note in 0012013, that's really useless and furthermore redundant with this ticket.

What I was hoping you would do, is provide a patch for the plugin that would do what you want, so I can review and integrate it. Without that, don't get your hopes too high of seeing a solution anytime soon.

kydow

kydow

2013-06-28 10:29

reporter   ~0037336

Last edited: 2013-06-28 10:31

Sorry i misunderstood your last note :(

You can find for the integration of the XmlImportExport plugin in the 1.3.0dev version the patch following.

1)Download the file PatchXmlImportExport.zip

2) cp PatchXmlImportExport/lang/strings_english.txt /usr/share/mantis/www/lang/

3) cp PatchXmlImportExport/core/bug_api.php /usr/share/mantis/www/core/

4) cp PatchXmlImportExport/core/bugnote_api.php /usr/share/mantis/www/core/

5) cp PatchXmlImportExport/core/constant_inc.php /usr/share/mantis/www/core/

6) cp PatchXmlImportExport/core/file_api.php /usr/share/mantis/www/core/

7) cp -r PatchXmlImportExport/XmlImportExport/ /usr/share/mantis/www/plugins/

Hope this can help

dregad

dregad

2013-06-28 17:43

developer   ~0037341

Thanks for the patch. It is generally better to provide changes as github pull request, Git patch, Unified diff (In this order of preference).

If you can't do that, At least specify exactly which version you're patching (commit's sha; if you downloaded a nighly build that's the letters and numbers at the end of zip/tar file's name)

kydow

kydow

2013-07-01 05:39

reporter   ~0037349

Last edited: 2013-07-02 11:14

Hello,

I'm using mantisbt-1.3.0dev-master-c4f2d6c (and mantisbt-1.2.15)

kydow

kydow

2013-07-03 12:02

reporter   ~0037370

I don't found how to update my issues with an XML Import.

So i use the Csv_Import plugin (https://github.com/mantisbt-plugins/csv-import)
to do the job.

I hope in the futur version to update issues with an XML Import will be possible.