REST API 2.0 and linking RT::IR tickets

Hmm … answering my own question here. It seems that linking of tickets is not supported by RT-Extension-REST2 although there is a patch available (that hasn’t made its way to the RT main distribution?) see REST2 - Linking tickets .

A work-around to link an incident report to an incident for the moment is (ab)using the ordinary web interface:

curl -H 'Authorization: token XX_TOKEN_XX'
       -H 'Content-Type: application/x-www-form-urlencoded'
       -d 'id=<incident_id_here>&BulkLink=1&SelectedTickets=<incident_report_id_here>&SubmitTicket=Link'  $RTIR_BASE_URL/RTIR/Incident/Display.html'

And the usual disclaimers: the above worked against RT 4.2.12 and RT::IR 3.2.1 and will probably crumble at any subsequent RT version update that happens to change the names of the web form parameters.