attachment to ticket version, what are the keys to link with?

Peter Wagemans's Avatar

Peter Wagemans

27 Feb, 2013 04:20 PM

I'm getting as far as dumping projects, tickets and ticket versions in my local database, but the last thing I want is to get the attachments.
Unlike the versions that are linked to the ticket using ticket number and project ID, I see no data in the attachments XML nodes that give me a clue on how to link to a version.
In the web interface, an enclosure is linked to a version, so I suppose there must be a way I don't know of.

Please help.

  <assigned-user-id type="integer"></assigned-user-id>
  <attachments-count type="integer">1</attachments-count>
  <watchers-ids>[134, 234, 345]</watchers-ids>
    <version type="Ticket::Version">
    <version type="Ticket::Version">
  <attachments type="array">
    <attachment-image type="Attachment">
      <created-at type="datetime">2009-11-23T18:16:03Z</created-at>
      <height type="integer">770</height>

// primary key, but where is the foreign key to the version node? <id type="integer">329182</id> <size type="integer">199629</size> <uploader-id type="integer">64212</uploader-id> <width type="integer">414</width> <url></url> </attachment-image> </attachments> </ticket>
  1. 1 Posted by Peter Wagemans on 27 Feb, 2013 04:22 PM

    Peter Wagemans's Avatar

    The XML quoted code in my post was messed up, please disregard all rubbish below "Please help."

  2. 2 Posted by Nicole on 27 Feb, 2013 06:07 PM

    Nicole's Avatar

    Peter -

    I've created a development ticket for this request. We'll update this discussion when we have a fix in place.


  3. 3 Posted by Julien on 06 Mar, 2013 07:29 PM

    Julien's Avatar

    Hi Peter,

    A little late to the game, but I have a suggestion for you: you can match ticket versions and attachments using the creation date, which should be identical or within 1 or 2s of each other. It's not perfect, but it should give you a workaround until we implement this properly.


  4. 4 Posted by Peter Wagemans on 07 Mar, 2013 12:52 PM

    Peter Wagemans's Avatar

    That seems like a good workaround. But I don't need an urgent temporary fix.
    I'll wait for Nicole's update ( with hopefully good news :-) before I pick up this project again.
    Thanks. -- peter

  5. Support Staff 5 Posted by Tiger Team on 07 Mar, 2013 02:55 PM

    Tiger Team's Avatar

    Ironically the code we use internally is exactly the same as what Julien suggested here - it just looks at creation time.

    We need to refactor the code so it's using proper keys and such, because this is just conceptually awful. So that might take a while for us to do.

  6. Tiger Team closed this discussion on 14 Mar, 2013 04:22 PM.

Discussions are closed to public comments.
If you need help with Lighthouse please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac