SetInitialCustomField and Unprivileged users


#1

Hello,

our RT is version 4.4.2

I set default values for custom fields for a queue.
In the case where an Unprivileged user sends a mail to the queue to create a new ticket, the custom fields keep empty. Whith a privilileged user it’s OK.

I made different attempts with the new right SetInitialCustomField and it still doesn’t work :

  • set either on the custom fields, or the queue, or globally
  • granted either to Requestor, or Everybody, or Unprivileged

Our Unprivileged users do have already a few rights : CreateTicket, ReplyToTicket, SeeCustomField (granted in fact to Everydoby).
So why SetInitialCustomField wouldn’t work for them ? Of course, we don’t want to grant them ModifyTicket nor ModifyCustomField.

Thanks to tell me if I am wrong or if it is the way it works, in that case I’ll have to use a scrip to fullfill the custom fields.

Elisabeth


#2

It seems other people have had this issue before with no obvious resolution unfortunately.

Is there anything in the logs (turning on debugging if needs be)?


#3

Thanks for your reply,
I’ve made new tests with the debug mode on: no errors but lots of SQL lines (select, insert, update…) which are of no help for me.

Elisabeth


#4

Bonjour Elisabeth :wink:

I think you’re reaching this bug:

commit 895e45f1483745a0b6d7293d93c3726ba7e59324
Author: Emmanuel Lacour elacour@easter-eggs.com
Date: Wed Oct 5 11:13:08 2016 +0200

Default CF values are meant to be set at creation time

diff --git a/rt/lib/RT/Record.pm b/rt/lib/RT/Record.pm
index 6d24385..97224a2 100644
--- a/rt/lib/RT/Record.pm
+++ b/rt/lib/RT/Record.pm
@@ -2135,6 +2135,7 @@ sub AddCustomFieldDefaultValues {
                 Field             => $cf->id,
                 Value             => $value,
                 RecordTransaction => 0,
+                ForCreation      => 1,
             );
             push @msgs, $msg unless $status;
         }

#5

Merci Emmanuel :wink:
I’ll try that fix, for the moment I use a scrip.

Thanks,
Elisabeth