ac3cloud / roust

Ruby client for Request Tracker's REST API
Other
6 stars 4 forks source link

Add link aliases for Parent(s) and Child(ren) #15

Closed Sarah-E-Greene closed 9 years ago

Sarah-E-Greene commented 9 years ago

From http://www.bestpractical.com/docs/rt/4.0/RT/Ticket.html:

Ticket links can be set up during create by passing the link type as a hash key and the ticket id to be linked to as a value (or a URI when linking to other objects). Multiple links of the same type can be created by passing an array ref. For example:

  Parents => 45,
  DependsOn => [ 15, 22 ],
  RefersTo => 'http://www.bestpractical.com',

Supported link types are MemberOf, HasMember, RefersTo, ReferredToBy, DependsOn and DependedOnBy. Also, Parents is alias for MemberOf and Members and Children are aliases for HasMember.

It would be great to support the following: @rt.ticket_links_add(3, { 'Parents' => [ 30, 40 ] }) @rt.ticket_links_add(4, { 'Children' => [ 50, 60 ] })

This would then translate to: @rt.ticket_links_add(3, { 'MemberOf' => [ 30, 40 ] }) @rt.ticket_links_add(4, { 'HasMember' => [ 50, 60 ] })

Sarah-E-Greene commented 9 years ago

Whoops - I can't read - these aliases (or at least Parents and Children) should already work. They just don't work on our version of RT.

Interestingly, @rt.ticket_links_add(3, { 'MemberOf' => [ 30, 40 ] }) does suggest that it has worked, but actually links to ticket 1, not 30 and 40.