Retrieving CustomFields with RT-Jasper

Hello,

I am not entirely sure this is the right forum for this question, however the only other information I can find about RT-Jasper is in this and the Devel mailing lists.

I have managed to install the RT-Jasper and RT-REST packages, and successfully run a report with the ID and Subject shown (both fields exposed directly) using Jasper Reports server, however I have had no luck getting any Custom Fields to return any data.

Can anyone supply sample JRXML showing how this is done?

Regards,

Michael Keetman

Hello,

I am not entirely sure this is the right forum for this question, however the only other information I can find about RT-Jasper is in this and the Devel mailing lists.

I have managed to install the RT-Jasper and RT-REST packages, and successfully run a report with the ID and Subject shown (both fields exposed directly) using Jasper Reports server, however I have had no luck getting any Custom Fields to return any data.

Can anyone supply sample JRXML showing how this is done?

Regards,

Michael Keetman

I have the exact same problem. The Subject and ID fields can be pulled, but no
other global field or custom field is even acknowledged as a valid field. I have
not had time to investigate further. If anyone has any ideas…?

Regards,
Ken

Hello, ****


I am not entirely sure this is the right forum for this question, however
the only other information I can find about RT-Jasper is in this and the
Devel mailing lists. ****


I have managed to install the RT-Jasper and RT-REST packages, and
successfully run a report with the ID and Subject shown (both fields
exposed directly) using Jasper Reports server, however I have had no luck
getting any Custom Fields to return any data. ****


Can anyone supply sample JRXML showing how this is done?

Isn’t it easier to let jasper talk to RT’s DB directly?

**

Regards,****


Michael Keetman****


Best regards, Ruslan.

Hello, ****


I am not entirely sure this is the right forum for this question, however
the only other information I can find about RT-Jasper is in this and the
Devel mailing lists. ****


I have managed to install the RT-Jasper and RT-REST packages, and
successfully run a report with the ID and Subject shown (both fields
exposed directly) using Jasper Reports server, however I have had no luck
getting any Custom Fields to return any data. ****


Can anyone supply sample JRXML showing how this is done?

Isn’t it easier to let jasper talk to RT’s DB directly?

Jasper can definitely talk to RT’s DB directly very simply. The problem
is that then you have to implement RT in the report tool. Using REST
makes access trivial.

Regards,
Ken

Hi,

I have made some progress with this after a good night’s sleep.

First of all, I pulled in a patch which exposes all the global fields (details here: Addons by hostcc · Pull Request #1 · bboksa/RT-REST · GitHub) (instead of just id, subject and timeworked)

Secondly, I spent time with the JRXML and a java debugger, and discovered the main problem is that the customFields is a hashmap supplied to the Reports server. This needs to be dereferenced and cast to the appropriate class (RTCustomField) to access the values.

An example:
Specification of the field:

Then when defining the text field in the report, this then needs to be cast to expose the customField value (in this case a custom field indicating the “Incident Start DateTime”) like so:




Hopefully this is understandable, and is helpful. I am not a Java programmer by any means, so if anyone here can suggest a better method, I am all ears.

Regards,

Michael Keetman-----Original Message-----
From: ktm@rice.edu [mailto:ktm@rice.edu]
Sent: Tuesday, 30 April 2013 2:51 AM
To: Ruslan Zakirov
Cc: Michael Keetman; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Retrieving CustomFields with RT-Jasper

On Mon, Apr 29, 2013 at 08:23:34PM +0400, Ruslan Zakirov wrote:

On Mon, Apr 29, 2013 at 10:41 AM, Michael Keetman < Michael.Keetman@qcn.com.au> wrote:

Hello, ****


I am not entirely sure this is the right forum for this question,
however the only other information I can find about RT-Jasper is in
this and the Devel mailing lists. ****


I have managed to install the RT-Jasper and RT-REST packages, and
successfully run a report with the ID and Subject shown (both fields
exposed directly) using Jasper Reports server, however I have had no
luck getting any Custom Fields to return any data. ****


Can anyone supply sample JRXML showing how this is done?

Isn’t it easier to let jasper talk to RT’s DB directly?

Jasper can definitely talk to RT’s DB directly very simply. The problem is that then you have to implement RT in the report tool. Using REST makes access trivial.

Regards,
Ken