Skip Menu |

This queue is for tickets about the RT-Client-REST CPAN distribution.

Report information
The Basics
Id: 42612
Status: rejected
Priority: 0/
Queue: RT-Client-REST

People
Owner: Nobody in particular
Requestors: howie [...] thingy.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.37
Fixed in: (no value)



Subject: Need a little more documentation on cf() method... (or BUG)
Using examples/edit_custom_field.pl with RT 3.6.4 I get the following error: ./rt-cf-test.pl howie xxxxxxxxxxxx 270318 CBUK test RT::Client::REST::UnknownRTException: cbuk: Custom field RT::CustomField=HASH(0xc5778fc) does not apply to this object # Ticket 270318 updated. id: ticket/270318 cf-cbuk: test However, the ticket DOES have a CF called CBUK. I've tried with or without the cf- prefix since it shows that in the output, various cases, but nothing seems to update the field. So either there's a bug in the docs, or the function doesn't work. It's not clear which.
Subject: Re: [rt.cpan.org #42612] Need a little more documentation on cf() method... (or BUG)
Date: Wed, 21 Jan 2009 11:36:16 -0500
To: bug-RT-Client-REST [...] rt.cpan.org
From: jpierce [...] cpan.org
You've not really provided very much information to work with e.g; sample code. Did you check the outstanding bugs on custom fields for guidance? -- Free map of local environmental resources: http://CambridgeMA.GreenMap.org -- MOTD on Sweetmorn, the 21st of Chaos, in the YOLD 3175: In Bob We Trust, All Others Bring Data. --Demmings
On Wed Jan 21 11:36:09 2009, JPIERCE wrote: Show quoted text
> You've not really provided very much information to work with e.g; > sample code. > Did you check the outstanding bugs on custom fields for guidance?
I used *your* sample code! The example provided with the module called examples/edit_custom_field.pl (I just noticed that I've renamed the file, as I copied it into a different directory, which may have made that less clear when I pasted the output). Two of those tickets are apparently RT 3.8 specific problems, and the last one is to do with permissions. The user I'm using to log in with is able to change this CF through the normal web interface. I don't really understand where the hash reference is coming from, since the two parameters for cf() are strings...
Subject: Re: [rt.cpan.org #42612] Need a little more documentation on cf() method... (or BUG)
Date: Wed, 21 Jan 2009 12:27:03 -0500
To: bug-RT-Client-REST [...] rt.cpan.org
From: jpierce [...] cpan.org
Show quoted text
>I used *your* sample code! The example provided with the module called
FYI, not *my* sample code, but the module's. There are many new volunteers just getting up to speed on supporting this module, of which I am one. Show quoted text
>The user I'm using to log in with is able to change this CF through the >normal web interface.
It can still be a permission problem, because the module creates things in a different way than RT itself does. IIRC, in RT you can create a CF without modify rights, but the REST user needs rights to modify CFs. Show quoted text
>I don't really understand where the hash reference is coming from, since >the two parameters for cf() are strings...
The hash is the module's internal structure for storing the CF data in RT::Client::REST::Object until you store() I don't personally have access to a 3.6 box to play with, but once you've reverified permissions, you might look at the last "stanza" of the to_form in ::Object. -- Free map of local environmental resources: http://CambridgeMA.GreenMap.org -- MOTD on Sweetmorn, the 21st of Chaos, in the YOLD 3175: In Bob We Trust, All Others Bring Data. --Demmings
On Wed Jan 21 12:26:54 2009, JPIERCE wrote: Show quoted text
> >I used *your* sample code! The example provided with the module called
> FYI, not *my* sample code, but the module's. There are many new volunteers > just getting up to speed on supporting this module, of which I am one.
My apologies. I've just had a few minutes to play with this some more, and I've found that it's a problem with that specific custom field. Two other CFs for tickets in the same queue work fine. At first I wondered about capitalisation, but one of the working CFs is 'SLA'. From the end of /rt/REST/1.0/ticket/280513: TimeLeft: 0 CF-SLA: 2212345 CF-OtherTicket: 2212345 CF-CBUK: Both the other CFs were set with the same command-line. Adding some print()s to_form shows the correct field for updating. The next stop seems to be edit() in REST.pm?
Show quoted text
> Adding some print()s to_form shows the correct field for updating. The > next stop seems to be edit() in REST.pm?
And you've verified the the rt client can set this field by name? Otherwise, you ought to be able to set customfields by number too CF-42 or somesuch. You can get the field id in the URL used to modify it in the web UI.
On Thu Apr 09 08:44:12 2009, JPIERCE wrote: Show quoted text
> > Adding some print()s to_form shows the correct field for updating. The > > next stop seems to be edit() in REST.pm?
> > And you've verified the the rt client can set this field by name? > Otherwise, you ought to be able to set customfields by number too > CF-42 or somesuch. You can get the field id in the URL used to > modify it in the web UI.
I hadn't verified it, and in fact it fails there too: # cbuk: Custom field RT::CustomField=HASH(0xbc5bce8) does not apply to this object I'll pursue this with rt-users, in that case. Trying to update CF-3 with edit_custom_field.pl also doesn't work, even with CFs that do work by name, incidentally. "RT::Client::REST::UnknownCustomFieldException: cf-3: Unknown custom field."
Show quoted text
>I hadn't verified it, and in fact it fails there too:
... Show quoted text
>I'll pursue this with rt-users, in that case.
Interesting, well good luck. Show quoted text
>Trying to update CF-3 with edit_custom_field.pl also doesn't work, even >with CFs that do work by name, incidentally.
Hmm, the REST interface must not expose that form. I know it exists(ed) internally. It used to be the only way to set CFs in OfflineEdits.