Toggle menu

getTasks

Allows current tasks to be queried using a range of parameters.

getQueryTasks, which uses the workflow search collection, is more performant than this function and has a range of Filters you can use to find tasks. getQueryTasks should be your preferred choice over this function which, although still supported, primarily exists for backwards compatibility.

Parameters

NameTypeDescription
activeBooleanIf true, only return tasks that are not suspended (either part of a process that is not suspended or not part of a process at all); If false, only tasks that are part of suspended process instances are returned
dueAfterDateOnly return tasks which are due after the given date
dueBeforeDateOnly return tasks which are due before the given date
dueDateDateOnly return tasks which are due on the given date
excludeSubtasksBooleanIf true, only return tasks that are not a subtask of another task; if false, do not filter the returned tasks
executionIdStringOnly return tasks which are part of the execution with the given id
firstResultNumberThe index of the first result returned in the selected (or default) sort order
includeBusinessKeyBooleanIf true include the business key of the process instance that contains the task in the response
includeCanUnclaimBooleanIf true, include unclaimability of tasks in response
includeEventsBooleanIf true include all events related to the tasks in the result
includeIdentityLinksBooleanInclude all users and groups associated with the returned tasks in the result
includeProcessDescriptionBooleanInclude the expanded process description (documentation field) in the response
includeProcessVariablesBooleanIf true, include process variables in the result
includeRawFormDataBooleanIncludes "rawFormData" in the response which is suitable for passing to the forms service - this is intended for the use of template code only
includeTaskBehavioursBooleanIf true returns the boolean properties canUnclaim, allowChaining and allowAutoClaim
includeTaskCommentsBooleanIf true, include task comments in the result
includeTaskDescriptionBooleanIf true, include expanded task description
includeTaskFormDataBooleanIf true, include task form data in the result
includeTaskVariablesBooleanIf true, include task local variables in the result
maxResultsNumberThe maximum number of results to return, starting from the 'firstResult' setting in the selected (or default) sort order. Defaults to 5000 if not set
orderByDueDate"asc" or "desc"Sort results by task due date using the specified ordering. Tasks without a due date appear last
orderByDueDateNullsFirst"asc" or "desc"Sort results by task due date using the specified ordering. Tasks without a due date appear first
orderByExecutionId"asc" or "desc"Sort results by execution id using the specified ordering
orderByProcessInstanceId"asc" or "desc"Order results by process instance ID (note that the process instance ID is represented as a string so 77 will appear after 100)
orderByTaskAssignee"asc" or "desc"Sort results by task assignee using the specified ordering
orderByTaskCreateTime"asc" or "desc"Sort results by task creation time using the specified ordering
orderByTaskDescription"asc" or "desc"Sort results by task description using the specified ordering
orderByTaskId"asc" or "desc"Sort results by task id using the specified ordering
orderByTaskName"asc" or "desc"Sort results by task nameusing the specified ordering
orderByTaskPriority"asc" or "desc"Sort results by task priority using the specified ordering
processDefinitionIdStringOnly return tasks using the process definition with the specified ID
processDefinitionKeyStringOnly return tasks using the process definition with the specified key
processDefinitionKeyInList<String>Only return tasks that have a process definition key included in the supplied list
processDefinitionKeyLikeStringOnly return tasks using process definitions with keys that are 'SQL LIKE' the specified pattern
processDefinitionNameStringOnly return tasks using the process definition with the specified name
processDefinitionNameLikeStringOnly return tasks using process definitions with names that are 'SQL LIKE' the specified pattern
processInstanceBusinessKeyStringOnly return tasks from a process instance with the specified business key
processInstanceBusinessKeyLikeStringOnly return tasks from process instances with the business keys that are 'SQL LIKE' the specified pattern
processInstanceIdStringOnly return tasks from the process instance with the specified ID
processInstanceIdsList<String>Only return tasks from this array of instances. An empty array returns no tasks
processVariableNameStringThese parameters are used together, processVariableName specifies a process variable name, processVariableValue specifies a value and processVariableCondition specifies a condition; valid values for variableCondition are "equals", "equalsIgnoreCase", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "like" and "notEquals"
processVariableValueString
processVariableConditionString
sortOrderArray<Object>Enables multi-column ordering. For example specify [{"taskPriority":"desc"},{"taskCreateTime":"asc"}] to sort by taskPriority then taskCreateTime
suspendedBooleanIf true, only select tasks that are suspended
taskAssigneeStringOnly return tasks that have been delegated to a specific user
taskAssigneeLikeStringOnly return tasks that have been delegated to users that are 'SQL LIKE' the specified pattern
taskCandidateGroupStringOnly return tasks for which users in the given group are candidates
taskCandidateGroupInArray<String>Only return tasks for which the 'candidateGroup' is one of the given groups
taskCandidateUserStringOnly return tasks for which the given user is a candidate
taskCreatedAfterDateOnly return tasks that were created after the given date
taskCreatedBeforeDateOnly return tasks that were created before the given date
taskCreatedOnDateOnly return tasks that were created on the given date
taskDefinitionKeyStringOnly return tasks with the given task definition key
taskDefinitionKeyLikeStringOnly return tasks with task definition keys that are 'SQL LIKE' the specified pattern
taskDelegationStateStringOnly return tasks with the given DelegationState (PENDING or RESOLVED)
taskDescriptionStringOnly return tasks with the given description
taskDescriptionLikeStringOnly select tasks with descriptions that are 'SQL LIKE' the specified pattern
taskIdStringReturn the task with the specified ID
taskInvolvedUserStringOnly return tasks that have involved a specific user
taskMaxPriorityNumberOnly return tasks with the given priority or lower
taskMinPriorityNumberOnly return tasks with the given priority or higher
taskNameStringOnly return tasks with the given name
taskNameLikeStringOnly return tasks with names that are 'SQL LIKE' the pattern
taskOwnerStringOnly select tasks owned by the specified user
taskPriorityNumberOnly select tasks with the given priority
taskUnassignedBooleanOnly select tasks which don't have an assignee
taskVariableConditionStringThese parameters are used together, taskVariableName specifies a task variable name, taskVariableValue specifies a value and taskVariableCondition specifies a condition; valid values for variableCondition are "equals", "equalsIgnoreCase", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "like" and "notEquals"
taskVariableNameString
taskVariableValueString
withoutDueDateBooleanOnly select tasks with no due date
withoutProcessVariableAllArray<string>Get tasks for instances that do not have one of these named variables. The more variables you name the broader your exclude list becomes, meaning fewer instances will be returned. An empty array returns all instances
withoutProcessVariableAnyArray<string>Get tasks for instances that do not have these named variables. The more variables you name the more specific your exclude list becomes, meaning more instances will be returned. An empty array returns no instances
withProcessVariableAllArray<string>Get tasks for instances that do have all of these named variables. The more variables you name the more specific your filter becomes, meaning fewer instances are returned. An empty array returns all instances
withProcessVariableAnyArray<string>Get tasks for instances that do have at least one of the named variables. The more variables you name the broader your filter becomes, meaning more instances will be returned. An empty array returns no instances
All parameters are optional
Last modified on July 29, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon