An item of work for a person or team to do, such as following up a lead, running a project step or completing a funnel action. A task is owned by an administrative organisation, can be assigned to a profile, a sub-organisation or a group, and can be related to a lead, a profile, a funnel or a named project. Tasks are soft closed rather than removed: completing sets completedDate, and cancelling sets both completedDate and the cancelled flag, so a task is only outstanding while both are unset.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| active | boolean | Whether the task is still outstanding, meaning it has been neither cancelled nor closed. |
| adminDomain | Organisation | The administrative organisation which owns the task. Every lookup of tasks is scoped by this, so a task is only ever visible within its own account. |
| assignedDate | Date | When the task was first assigned to someone. Null while the task has never been assigned. |
| assignedToGroup | Group | Group the task is assigned to, so that any member of the group can pick it up. Null when the task is assigned to an individual or to an organisation instead. |
| assignedToOrg | Organisation | Sub-organisation the task has been passed to, such as a dealer or reseller expected to handle it. Distinct from the admin domain, which is the account that owns the task. |
| assignedToProfile | Profile | The team member responsible for doing the task. Null means the task is unassigned and will appear in the unassigned queue. |
| calEvent | CalEvent | Calendar event this task is linked to, when the task has been scheduled into someone's calendar. Null for a task which is not scheduled. |
| cancelled | boolean | Whether the task was abandoned rather than done. Cancelling also sets the completed date, so this flag is what distinguishes an abandoned task from a finished one, and cancelled tasks are left out of every active-task search. |
| completedDate | Date | When the task was closed. This is set both when the task is completed and when it is cancelled, so it does not on its own mean the work was done - check the cancelled flag as well, or use isCompletedOk. |
| completedOk | boolean | Whether the task was finished successfully, meaning it has a completed date and was not cancelled. Use this rather than testing the completed date alone, which is also set when a task is cancelled. |
| createDate | Date | When the task was created. Task listings are ordered by this, newest first. Never null. |
| dueDate | Date | When the task is due to be done. Null means the task has no deadline, and the due-task searches treat a null due date as due now. |
| estimatedHours | Integer | Estimate of how many hours the task should take, entered when the task is planned. Null if no estimate was given. Compare it with hoursWorked, which sums the timesheet entries actually logged against the task. |
| formattedName | String | A label for the task suitable for showing in a list or a message: the title if one was entered, otherwise the word Task followed by the last four digits of the task id. Never null. |
| funnel | FunnelRepository | The funnel this task belongs to, when the task was raised by a funnel step. Null for tasks created outside a funnel. |
| id | long | Unique database identifier for this task, also used as the fallback for its formatted name. |
| projectName | String | Identifier of the project this task belongs to, used to gather all the tasks for one project together. Null for a task which is not part of a project. |
| relatedLead | Lead | The lead this task was raised against, for tasks which are part of working a lead. Null for tasks not tied to a lead. |
| relatedProfile | Profile | The profile the task is about, for example the customer being followed up. This is the subject of the task, not the person who has to do it, which is the assigned profile. |
| takenDate | Date | When a user took this task for themselves, for tasks which are picked up from a shared queue rather than assigned. Null if nobody has taken it. |
| taskDescription | String | Longer explanation of what the task involves, for the person doing it. |
| taskName | String | Identifier used to refer to this task from within a funnel definition, so a funnel step can find the task it created. Not a display label, and not unique across tasks: task listings group by it to give the set of task types in use. |
| title | String | Short free-text description of the task, shown in listings. Not an identifier and not guaranteed to be set; when it is blank the formatted name falls back to a number derived from the task id. |
Methods
getId() · getAdminDomain() · getCalEvent() · getEstimatedHours() · getTaskName() · getCreateDate() · getTakenDate() · getCompletedDate() · getDueDate() · getAssignedToGroup() · getAssignedToOrg() · getAssignedToProfile() · getRelatedLead() · getRelatedProfile() · getTitle() · getTaskDescription() · getFunnel() · getProjectName() · isCancelled() · getAssignedDate() · getFormattedName() · is(String type) · hoursWorked() · isActive() · isCompletedOk()
getId()
Returns: long
Unique database identifier for this task, also used as the fallback for its formatted name.
getAdminDomain()
Returns: Organisation
The administrative organisation which owns the task. Every lookup of tasks is scoped by this, so a task is only ever visible within its own account.
getCalEvent()
Returns: CalEvent
Calendar event this task is linked to, when the task has been scheduled into someone's calendar. Null for a task which is not scheduled.
getEstimatedHours()
Returns: Integer
Estimate of how many hours the task should take, entered when the task is planned. Null if no estimate was given. Compare it with hoursWorked, which sums the timesheet entries actually logged against the task.
getTaskName()
Returns: String
Identifier used to refer to this task from within a funnel definition, so a funnel step can find the task it created. Not a display label, and not unique across tasks: task listings group by it to give the set of task types in use.
getCreateDate()
Returns: Date
When the task was created. Task listings are ordered by this, newest first. Never null.
getTakenDate()
Returns: Date
When a user took this task for themselves, for tasks which are picked up from a shared queue rather than assigned. Null if nobody has taken it.
getCompletedDate()
Returns: Date
When the task was closed. This is set both when the task is completed and when it is cancelled, so it does not on its own mean the work was done - check the cancelled flag as well, or use isCompletedOk.
getDueDate()
Returns: Date
When the task is due to be done. Null means the task has no deadline, and the due-task searches treat a null due date as due now.
getAssignedToGroup()
Returns: Group
Group the task is assigned to, so that any member of the group can pick it up. Null when the task is assigned to an individual or to an organisation instead.
getAssignedToOrg()
Returns: Organisation
Sub-organisation the task has been passed to, such as a dealer or reseller expected to handle it. Distinct from the admin domain, which is the account that owns the task.
getAssignedToProfile()
Returns: Profile
The team member responsible for doing the task. Null means the task is unassigned and will appear in the unassigned queue.
getRelatedLead()
Returns: Lead
The lead this task was raised against, for tasks which are part of working a lead. Null for tasks not tied to a lead.
getRelatedProfile()
Returns: Profile
The profile the task is about, for example the customer being followed up. This is the subject of the task, not the person who has to do it, which is the assigned profile.
getTitle()
Returns: String
Short free-text description of the task, shown in listings. Not an identifier and not guaranteed to be set; when it is blank the formatted name falls back to a number derived from the task id.
getTaskDescription()
Returns: String
Longer explanation of what the task involves, for the person doing it.
getFunnel()
Returns: FunnelRepository
The funnel this task belongs to, when the task was raised by a funnel step. Null for tasks created outside a funnel.
getProjectName()
Returns: String
Identifier of the project this task belongs to, used to gather all the tasks for one project together. Null for a task which is not part of a project.
isCancelled()
Returns: boolean
Whether the task was abandoned rather than done. Cancelling also sets the completed date, so this flag is what distinguishes an abandoned task from a finished one, and cancelled tasks are left out of every active-task search.
getAssignedDate()
Returns: Date
When the task was first assigned to someone. Null while the task has never been assigned.
getFormattedName()
Returns: String
A label for the task suitable for showing in a list or a message: the title if one was entered, otherwise the word Task followed by the last four digits of the task id. Never null.
is(String type)
Returns: boolean
Type test used by templates and permission checks to ask what kind of record this is. Only the value task matches, ignoring case.
| Parameter | Description |
|---|---|
type | the type name being tested for |
hoursWorked()
Returns: double
Sums the hours on every timesheet entry logged against this task, with no date restriction. This reads from the database on each call, so avoid calling it inside a loop over many tasks.
isActive()
Returns: boolean
Whether the task is still outstanding, meaning it has been neither cancelled nor closed.
isCompletedOk()
Returns: boolean
Whether the task was finished successfully, meaning it has a completed date and was not cancelled. Use this rather than testing the completed date alone, which is also set when a task is cancelled.