Set custom field on a transaction via REST?

Hey,

I’ve added a custom field for transactions to a queue. I can set the
custom field if I use the web UI to comment or reply. But, I can’t seem
to set it when using the REST API, which is why I want to have the CF.

I’ve tried variations of CF.{Name} [0] and CF-Name [1] but none of
those work. Looking in:
/usr/share/request-tracker4/html/REST/1.0/Forms/ticket/comment
I see nothing that mentions custom fields. I assume this is the correct
file as the “Got args” line is printed out when I submit my request.

Example log line:
Jan 20 15:50:46 prod-rt RT: [23112] Got args Text CF-Name Action.
(/usr/share/request-tracker4/html/REST/1.0/Forms/ticket/comment:59)

Any suggestions which by much appreciated.

This is RT 4.2.8 running on Debian Jessie.

[0] As mentioned on: GitHub - z4r/python-rtkit: Python Api for Request Tracker's REST interface
[1] As used in the rt CLI for creating a ticket

Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz | linux.conf.au 2016
New Zealand’s only Cloud: | LCA By the Bay, Geelong, AU
https://catalyst.net.nz/cloud | http://lca2016.linux.org.au

Hey,

Hi Andrew,

I’ve added a custom field for transactions to a queue. I can set the
custom field if I use the web UI to comment or reply. But, I can’t seem
to set it when using the REST API, which is why I want to have the CF.

I don’t believe the 1.0 REST API supports txn CFs.

Some options are:

  • Hack together something for the 1.0 REST.
  • Totally bypass the REST and do something via perl executables and ssh.
  • Try out the new REST interface

Depending on your needs the above list may be bad advice - use with caution.

HTH,

-m

Hey,On Wed, 2016-01-20 at 08:28 -0600, Matt Zagrabelny wrote:

I don’t believe the 1.0 REST API supports txn CFs.

Some options are:

  • Hack together something for the 1.0 REST.
  • Totally bypass the REST and do something via perl executables and
    ssh.
  • Try out the new REST interface

GitHub - bestpractical/rt-extension-rest2

Depending on your needs the above list may be bad advice - use with
caution.

It looked like the path of least resistance for now was to add this
functionality to the REST 1.0 interface.

The last three commits on this branch[0] add required functionality.
Commit 35650ec actually extends the API and provides test cases.

Cheers,
Andrew

[0] GitHub - catalyst/rt at 4.2/add-txn-rest-customfield

Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz | linux.conf.au 2016
New Zealand’s only Cloud: | LCA By the Bay, Geelong, AU
https://catalyst.net.nz/cloud | http://lca2016.linux.org.au