skip to Main Content

xplan xmerge

Search
Generic filters
Exact matches only
Filter by Custom Post Type

Try these: client detailstasks syntaxsuperannuation

Tasks

Syntax to extract details from Xplan Tasks:

Setec Astronomy

<:for item in $client.tasks_client:>
Task ID: <:=item.id:>
Task Name: <:=item.subject:>
<:end:>

Task Fields

All the fields below can be used in the loop above:

Field

Path

Syntax

Task ID id <:=item.id:>
Type type <:=item.type:>
Subtype subtype <:=item.subtype:>
Task Kind taskkind <:=item.taskkind:>
Subject subject <:=item.subject:>
Description description <:=item.description:>
Status status <:=item.status:>
Outcome outcome <:=item.outcome:>
More    
Template id templateid <:=item.templateid:>
Assigned By assigner <:=item.assigner:>
Assigned To assignee <:=item.assignee:>
Client client <:=item.client:>
Group egroup <:=item.egroup:>
Priority priority <:=item.priority:>
Due Date duedate <:=item.duedate:>
Due Days duedays <:=item.duedays:>
Reminder Days reminderdays <:=item.reminderdays:>
Completed Date completedate <:=item.completedate:>
Deactivated deactivated <:=item.deactivated:>
Linked Thread ID threadid <:=item.threadid:>
Funds    
Likelihood likelihood <:=item.likelihood:>
FUA fua <:=item.fua:>
Initial Revenue revenue <:=item.revenue:>
Ongoing Revenue ongoing <:=item.ongoing:>
Forecast FUA forecast_fua <:=item.forecast_fua:>
Forecast Initial forecast_revenue <:=item.forecast_revenue:>
Forecast Ongoing forecast_revenue <:=item.forecast_ongoing:>
Supplementary    
Benchmark Days benchmark <:=item.benchmark:>
Benchmark Minutes benchmin <:=item.benchmin:>
Viewable by Entity entity_viewable <:=item.entity_viewable:>
Permission permission <:=item.permission:>
Notifications notification <:=item.notification:>
Linked Diary linked_with_diary_event <:=item.linked_with_diary_event:>
Time    
Force Time Taken forcetimetaken <:=item.forcetimetaken:>
Time Taken timetaken <:=item.timetaken:>
Non Charged Time Taken nc_timetaken <:=item.nc_timetaken:>
Total Time Taken total_timetaken <:=item.total_timetaken:>
Activated Stamp activatedstamp <:=item.activatedstamp:>
Modified Stamp modifiedstamp <:=item.modifiedstamp:>
Created Stamp createdstamp <:=item.createdstamp:>
Modified by modifiedby <:=item.modifiedby:>

Check for Tasks

Using the len() function is the simplest way to see if any tasks or specific filtered tasks exist:

Setec Astronomy

<:if len($client.tasks_client):>
<:for item in $client.tasks_client:>
Task Name <:=item.subject:>
<:end:>
<:else:>
No Tasks found
<:end:>

More specific task search :

Setec Astronomy

<:if len([x for x in $client.tasks_client.filter(type=’General’) if str(x.status.text) != “Complete”]):>
<:for item in [x for x in $client.tasks_client.filter(type=’General’) if str(x.status.text) != “Complete”]:>
Task Name <:=item.subject:>
<:end:>
<:else:>
No General Tasks without a “complete” status found
<:end:>

Filtering Tasks

Filter to type

Setec Astronomy

<:if len($client.tasks_client.filter(type=’General’)):>
<:for item in $client.tasks_client.filter(type=’General’):>
Task Name <:=item.subject:>
<:end:>
<:else:>
No Tasks of this type found
<:end:>

Alternative multi conditional filter

This style syntax construction can be useful for when you have multiple conditions or other complex patterns you need to include in your conditioning:

Setec Astronomy

<:for item in [x for x in $client.tasks_client.filter(type=’General’) if int(x.status.value) not [‘1000’, ‘2000’]]:>
Task Name <:=item.subject:>
<:end:>

Filtering Tasks by date range

Example of outputting tasks that were completed within the last year:

Setec Astronomy

<:for item in $client.tasks_client:>
<:if int(datetime_merge - 365 * Day) <= int(item.completedate):>
Task Name <:=item.subject:>
<:end:>
<:end:>

Sorting Tasks

You can easily sort your Tasks xmerge with the .sort() function:

Setec Astronomy

<:for item in $client.tasks_client.sort(‘duedate’):>
Task Name <:=item.subject:>
<:end:>

Reverse Sort

You can easily reverse the sort by adding “-” into the .sort() function

Setec Astronomy

<:for item in $client.tasks_client.sort('-duedate'):>
Task Name <:=item.subject:>
<:end:>

Sort and Filter

Example of how sort and filter can be used together:

Setec Astronomy

<:for item in $client.tasks_client.filter(type=’General’).sort(‘status’):>
Task Name <:=item.subject:>
<:end:>

Output most recently activated task

This code sorts the tasks by most recently activated first but then limits the output to only show 1 record:

Setec Astronomy

<:for item in $client.tasks_client.sort(‘-activatedstamp’)[:1]:>
Task Name <:=item.subject:>
<:end:>

See also

Back To Top