[rt-users] creating tickets with CF values without ModifyCustomField right

Christian Loos cloos at netcologne.de
Tue Jun 3 06:18:17 EDT 2014


Am 02.06.2014 22:46, schrieb Parish, Brent:
> We have this same problem here.
> If you don't want to wait for the feature request to be implemented, here is one way around it:
> 
> I ended up creating a second set (copy) of the custom fields. 
> I named them the same thing, but with an underscore character appended.
> (e.g. If the custom field is called "Application" the second/copy custom field would be called "Application_")
> 
> Then I gave 'everyone' the right to edit "Application_" but not "Application".
> I created a scrip that fires on Ticket Create that looks for all custom fields with the underscore appended and copies them to the custom field of the same name (but without the underscore).  The same scrip also moves the ticket to the appropriate queue.
> 
> In this way, the users can now create new tickets and set the initial values of the custom fields.  But once the ticket has been created (thanks to the scrip), it is moved into the proper queue and the users do not have rights to change the custom field values there.
> 
> Since this 'general' queue needs to have both sets of custom fields applied to it (so the scrip can copy values from one set to the next), I also had to customize the Self Service screen to hide the custom fields that did not have the underscore appended (otherwise the user get confused seeing two copies of [almost] the exact same field name).  
> 
> Just an option that seems to work well for us.  =)
> 
> - Brent

I think for you situation there is a much simpler solution without
duplicate custom fields:
Grant Everyone SeeCustomField on the custom field level and
ModifyCustomField on the queue level only for the queue where the ticket
is created.
If the user create the ticket they have the ModifyCustomField from the
queue level. If you then move the ticket to the right queue they have
only SeeCustomField from the custom field level.

I will think about if the "ticket create in one queue and then move to
another queue" will fit in my needs.


As we actually use a custom form within RT to create the ticket there is
a much simpler solution to allow users with SeeCustomField to set custom
field values on ticket create. Attached a patch.

This patch isn't enough if you use the built-in ticket create form, as
Elements/EditCustomFields limit the custom fields to which the user has
ModifyCustomField right.
To fix this you have to inspect in Elements/EditCustomFields the request
path and if it's '/Ticket/Create.html' then limit the custom fields by
SeeCustomField right otherwiese limit by ModifyCustomField right.

May one of the RT developers can have a look on this suggestions if this
would fit for inclusion in RT 4.4.

Also it should be discussed if SeeCustomField is sufficient to create
tickets with custom field values or if a new right
SetCustomFieldValuesOnCreate should be introduced.

Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CustomField.pm.patch
Type: text/x-patch
Size: 596 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140603/746e659d/attachment.bin>


More information about the rt-users mailing list