Modify

Opened 5 years ago

Closed 4 years ago

#5564 closed defect (duplicate)

Add support for importing the 'time' field

Reported by: jevans Owned by: farialima
Priority: normal Component: TicketImportPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Defaulting to now is great but it would be nice when importing tickets from another system to be able to keep the original date issues were reported.

Attachments (0)

Change History (6)

comment:1 Changed 4 years ago by hoff.st@…

  • Resolution set to duplicate
  • Status changed from new to closed

This request - preserving historic dates on import - is already part of #4783. I'll mention this additional request there.

comment:2 Changed 4 years ago by luizfernando

  • Resolution duplicate deleted
  • Status changed from closed to reopened
  • Trac Release changed from 0.11 to 0.12

We've downloaded the last version ([9736]), however we still can't import the time field, keeping its original value given by CSV query export.

This problem implies in losing creation time information when changing tickets outside the Trac environment. (when using the procedure CSV query export > modify CSV > import)

Nice plug-in, keep the good work.

comment:3 follow-up: Changed 4 years ago by luizfernando

  • We've just realized that the time column can be ommitted in the csv file imported via this plug-in.
  • We were worried because the importer informed that the creation time field on all tickets imported would be changed to (now), because no time column was present.
  • However, we just realized that even importing with the 'time' column absent, the time field isn't changing on tickets, keeping the original database value. We reached this conclusion looking at this comment and code:
            # if 'set' is true, this will be the value that will be set by default (even if the default value in the Ticket class is different)
            # if 'set' is false, the value is computed by Trac and we don't have anything to do
            computedfields = {'status':      { 'value':'new',         'set': True },
                              'resolution' : { 'value': "''(None)''", 'set': False },
                              'reporter' :   { 'value': reporter,     'set': True  },
                              'time' :       { 'value': "''(now)''",  'set': False },
                              'changetime' : { 'value': "''(now)''",  'set': False } }
    

Are we right?

  • So, concluding, in order to make everything work smoothly, I just need to remove the modified and time columns from the Trac query exported csv file.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 4 years ago by jevans

Replying to luizfernando:

  • We've just realized that the time column can be ommitted in the csv file imported via this plug-in.
  • We were worried because the importer informed that the creation time field on all tickets imported would be changed to (now), because no time column was present.
  • However, we just realized that even importing with the 'time' column absent, the time field isn't changing on tickets, keeping the original database value. We reached this conclusion looking at this comment and code:

Right, creation time of existing Trac tickets won't be affected. Our concern was to preserve the creation time of tickets being imported from another system.

comment:5 Changed 4 years ago by anonymous

  • Trac Release changed from 0.12 to 0.11

comment:6 in reply to: ↑ 4 Changed 4 years ago by farialima

  • Resolution set to duplicate
  • Status changed from reopened to closed

Replying to jevans:

Right, creation time of existing Trac tickets won't be affected.

Absolutely: and it's not specific to time fields: if you re-import modified tickets, the columns that aren't there will not be modified. To make sure you are not modifying things you don't want to modify, remove the columns that have no modifs is a good idea.

Replying to jevans:

Our concern was to preserve the creation time of tickets being imported from another system.

I didn't plan for this usage scenario when I created this plugin... the main goal was to be able to create/edits tickets for one Trac instance in Excel, not to migrate things between two trac instances... I'm sure it could be implemented with limited work, any idea/patch is welcome.

In the meantime, I think that this ticket is still a dup of #4783 - closing as such.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from farialima. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.