Operation Details
Description: Returns the identifiers of the tasks assigned to the specified organization object filtered by priority and which have been assigned to that object for longest period of time.
Sterotype: nsmulti
SQL
SELECT
  t.taskID,
  t.versionNo
INTO
  :taskID,
  :versionNo 
FROM
  TaskAssignment ta,
  Task t 
WHERE 
          ta.relatedID = :relatedID 
  AND ta.assigneeType = :assigneeType
  AND t.priority = :priority 
  AND ta.taskID = t.taskID 
  AND t.reservedBy IS NULL
ORDER BY t.priority ASC,
  t.assignedDateTime ASC