How To Merge Tickets with "REST2" API

Hi,

We’re running RT 5.0.0 and I couldn’t find any solution for this on RT::Extension::REST2 - Adds a modern REST API to RT under /REST/2.0/ - metacpan.org or in the forums.

Has anyone successfully managed to merge tickets using this API (not the Perl SDK/API) but crafting raw API calls?

I’ve been trying to do this with PowerShell but so far with no success (despite being able to create/resolve tickets just fine).

My latest attempt was issuing a PUT request to (example) ‘https://domain/REST/2.0/ticket/123456’ with some JSON of the format:

{
  "123456-MemberOf": "",
  "123456-RefersTo": "",
  "DependsOn-123456": "",
  "MemberOf-123456": "",
  "RefersTo-123456": "",
  "id": "123456",
  "123456-DependsOn": "",
  "123456-MergeInto": "999999"
}

There is no error thrown, but the tickets aren’t merged.

Any pointers would be greatly appreciated.

Regards,

Robin

It appears Merge support was added in 5.0.2, as there is an example in the current docs https://docs.bestpractical.com/rt/5.0.2/RT/REST2.html#Ticket-Examples

    # Merge a ticket into another
    curl -X PUT -H "Content-Type: application/json" -u 'root:password'
        -d '{ "MergeInto": 3 }'
        'https://myrt.com/REST/2.0/ticket/6'
1 Like

Ah, thanks! Somewhat confusingly I’d reached the metacpan.org link for REST2 docs via REST - Request Tracker Wiki (and had searched for “merge” but there was nothing). I wasn’t aware of docs.bestpractical.com, nor does it appear in Google.

I’ll see if our test instance is running 5.0.2 and try it out :slight_smile: