Custom fields, templates and scrips

I have two things I need to happen in my RT4 instance:

  • one is to enable a custom field for a queue but only certain groups should see it when opening a ticket in that queue. to make this work I added the custom field to the queue under /Admin/Queues/CustomFields.html and also gave the desired group the ‘View Custom Fields’ permission under /Admin/CustomFields/GroupRights.html?id=6 however, this seems to still show that custom fields to all groups that access the ticket… is there another way to restrict this particular custom field to just this particular group?

  • another one I want is to have a ticket moved from one queue to another based on a trigger (eg. when a custom field has a certain value). is there an example of a template + scrip combination that can do this?

Hi.

  1. Why are you editing the template? Just set the group rights of this CF according to your needs, and via “Applies to” assign it to the queues.

  2. No need for a template, just create a custom scrip: Condition and Action set to “User Defined”, leave the template blank. Set sth. like this as custom condition:

    my $CFName = ‘CustomerID’;
    my $Value = ‘23’;

    if( $self->TicketObj->FirstCustomFieldValue( $CFName ) eq $Value ) {
    $self->TicketObj->SetQueue(“special-customer-queue”);
    }
    return 0;

1 Like

Hello,

Also check group access rights for the queue, in particular
SeeCustomField and ModifyCustomField. If you want granular access right
management based on CF remove these group rights from the Queue (for the
particular group) and specify it for every CF.

Regards

1 Like

@Daniel_Rauer should I assign it to queues, or rather to groups? if to queues as you said, does that mean a certain CF will only be visible to a particular combination of group + queue?

I was also wondering if instead of moving a ticket to another queue, is it possible to have permissions set to different groups based on approval status… I know there is an Approvals queue but I do not know how to capture the status of the Approved radio button to trigger another scrip, which would change the owner to the next group that should access this ticket… and so on. Is there an example of multi-level approval workflow posted anywhere?

You have to “assign” it to both, group and queue: By group/user assignment you set the permission, so who is allowed to see this field. By queue assignment you set visibility, so in which queue(s) this CF may appear.
So you want to set both: visibility by queue, and permission by user/group.

Bye, Daniel