RT 4.0.24 Documentation

This version has reached its end of life and is out of support. Please contact us for upgrade assistance.

RT::Queue

Go to latest version →

NAME

  RT::Queue - an RT Queue object

SYNOPSIS

  use RT::Queue;

DESCRIPTION

An RT queue object.

METHODS

AddRights RIGHT, DESCRIPTION [, ...]

Adds the given rights to the list of possible rights. This method should be called during server startup, not at runtime.

AddRightCategories RIGHT, CATEGORY [, ...]

Adds the given right and category pairs to the list of right categories. This method should be called during server startup, not at runtime.

AvailableRights

Returns a hash of available rights for this object. The keys are the right names and the values are a description of what the rights do

RightCategories

Returns a hashref where the keys are rights for this type of object and the values are the category (General, Staff, Admin) the right falls into.

ValidateLifecycle NAME

Takes a lifecycle name. Returns true if it's an ok name and such lifecycle is configured. Returns undef otherwise.

ActiveStatusArray

Returns an array of all ActiveStatuses for this queue

InactiveStatusArray

Returns an array of all InactiveStatuses for this queue

StatusArray

Returns an array of all statuses for this queue

IsValidStatus value

Returns true if value is a valid status. Otherwise, returns 0.

IsActiveStatus value

Returns true if value is a Active status. Otherwise, returns 0

IsInactiveStatus value

Returns true if value is a Inactive status. Otherwise, returns 0

Create(ARGS)

Arguments: ARGS is a hash of named parameters. Valid parameters are:

  Name (required)
  Description
  CorrespondAddress
  CommentAddress
  InitialPriority
  FinalPriority
  DefaultDueIn
 

If you pass the ACL check, it creates the queue and returns its queue id.

SetDisabled

Takes a boolean. 1 will cause this queue to no longer be available for tickets. 0 will re-enable this queue.

Load

Takes either a numerical id or a textual Name and loads the specified queue.

ValidateName NAME

Takes a queue name. Returns true if it's an ok name for a new queue. Returns undef if there's already a queue by that name.

SetSign

Templates

Returns an RT::Templates object of all of this queue's templates.

CustomField NAME

Load the queue-specific custom field named NAME

TicketCustomFields

Returns an RT::CustomFields object containing all global and queue-specific ticket custom fields.

TicketTransactionCustomFields

Returns an RT::CustomFields object containing all global and queue-specific transaction custom fields.

AllRoleGroupTypes

Returns a list of the names of the various role group types that this queue has, including Requestor and Owner. If you don't want them, see "ManageableRoleGroupTypes".

IsRoleGroupType

Returns whether the passed-in type is a role group type.

ManageableRoleGroupTypes

Returns a list of the names of the various role group types that this queue has, excluding Requestor and Owner. If you want them, see "AllRoleGroupTypes".

IsManageableRoleGroupType

Returns whether the passed-in type is a manageable role group type.

_CreateQueueGroups

Create the ticket groups and links for this ticket. This routine expects to be called from Ticket->Create _inside of a transaction_

It will create four groups for this ticket: Requestor, Cc, AdminCc and Owner.

It will return true on success and undef on failure.

AddWatcher

AddWatcher takes a parameter hash. The keys are as follows:

Type One of Requestor, Cc, AdminCc

PrinicpalId The RT::Principal id of the user or group that's being added as a watcher Email The email address of the new watcher. If a user with this email address can't be found, a new nonprivileged user will be created.

If the watcher you're trying to set has an RT account, set the Owner parameter to their User Id. Otherwise, set the Email parameter to their Email address.

Returns a tuple of (status/id, message).

DeleteWatcher { Type => TYPE, PrincipalId => PRINCIPAL_ID, Email => EMAIL_ADDRESS }

Deletes a queue watcher. Takes two arguments:

Type (one of Requestor,Cc,AdminCc)

and one of

PrincipalId (an RT::Principal Id of the watcher you want to remove) OR Email (the email address of an existing wathcer)

AdminCcAddresses

returns String: All queue AdminCc email addresses as a string

CcAddresses

returns String: All queue Ccs as a string of email addresses

Cc

Takes nothing. Returns an RT::Group object which contains this Queue's Ccs. If the user doesn't have "ShowQueue" permission, returns an empty group

AdminCc

Takes nothing. Returns an RT::Group object which contains this Queue's AdminCcs. If the user doesn't have "ShowQueue" permission, returns an empty group

IsWatcher { Type => TYPE, PrincipalId => PRINCIPAL_ID }

Takes a param hash with the attributes Type and PrincipalId

Type is one of Requestor, Cc, AdminCc and Owner

PrincipalId is an RT::Principal id

Returns true if that principal is a member of the group Type for this queue

IsCc PRINCIPAL_ID

Takes an RT::Principal id. Returns true if the principal is a requestor of the current queue.

IsAdminCc PRINCIPAL_ID

Takes an RT::Principal id. Returns true if the principal is a requestor of the current queue.

CurrentUserHasRight

Takes one argument. A textual string with the name of the right we want to check. Returns true if the current user has that right for this queue. Returns undef otherwise.

CurrentUserCanSee

Returns true if the current user can see the queue, using SeeQueue

HasRight

Takes a param hash with the fields 'Right' and 'Principal'. Principal defaults to the current user. Returns true if the principal has that right for this queue. Returns undef otherwise.

id

Returns the current value of id. (In the database, id is stored as int(11).)

Name

Returns the current value of Name. (In the database, Name is stored as varchar(200).)

SetName VALUE

Set Name to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Name will be stored as a varchar(200).)

Description

Returns the current value of Description. (In the database, Description is stored as varchar(255).)

SetDescription VALUE

Set Description to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Description will be stored as a varchar(255).)

CorrespondAddress

Returns the current value of CorrespondAddress. (In the database, CorrespondAddress is stored as varchar(120).)

SetCorrespondAddress VALUE

Set CorrespondAddress to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, CorrespondAddress will be stored as a varchar(120).)

CommentAddress

Returns the current value of CommentAddress. (In the database, CommentAddress is stored as varchar(120).)

SetCommentAddress VALUE

Set CommentAddress to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, CommentAddress will be stored as a varchar(120).)

Lifecycle

Returns the current value of Lifecycle. (In the database, Lifecycle is stored as varchar(32).)

SetLifecycle VALUE

Set Lifecycle to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Lifecycle will be stored as a varchar(32).)

SubjectTag

Returns the current value of SubjectTag. (In the database, SubjectTag is stored as varchar(120).)

SetSubjectTag VALUE

Set SubjectTag to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, SubjectTag will be stored as a varchar(120).)

InitialPriority

Returns the current value of InitialPriority. (In the database, InitialPriority is stored as int(11).)

SetInitialPriority VALUE

Set InitialPriority to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, InitialPriority will be stored as a int(11).)

FinalPriority

Returns the current value of FinalPriority. (In the database, FinalPriority is stored as int(11).)

SetFinalPriority VALUE

Set FinalPriority to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, FinalPriority will be stored as a int(11).)

DefaultDueIn

Returns the current value of DefaultDueIn. (In the database, DefaultDueIn is stored as int(11).)

SetDefaultDueIn VALUE

Set DefaultDueIn to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, DefaultDueIn will be stored as a int(11).)

Creator

Returns the current value of Creator. (In the database, Creator is stored as int(11).)

Created

Returns the current value of Created. (In the database, Created is stored as datetime.)

LastUpdatedBy

Returns the current value of LastUpdatedBy. (In the database, LastUpdatedBy is stored as int(11).)

LastUpdated

Returns the current value of LastUpdated. (In the database, LastUpdated is stored as datetime.)

Disabled

Returns the current value of Disabled. (In the database, Disabled is stored as smallint(6).)

SetDisabled VALUE

Set Disabled to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Disabled will be stored as a smallint(6).)

← Back to index