Task Examples

Query by Task Name

Query for task by task name.

[
  {
    "Action": "Query",
    "QueryType": "TaskByName",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      "Design"
    ]
  }
]

Query by Task Code

Query for task by task code.

[
  {
    "Action": "Query",
    "QueryType": "TaskByCode",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      "CRP"
    ]
  }
]

Query by Task Id

Query for tasks by an array of task Id's.

[
  {
    "Action": "Query",
    "QueryType": "TaskByIds",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      [
        2,
        8,
        12
      ]
    ]
  }
]

Query Task by UDF Value

Query for tasks by a user defined field value.

[
  {
    "Action": "Query",
    "QueryType": "TaskEqualToUDFValue",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      "Region",
      2
    ]
  }
]

Query Task by Null UDF Value

Query for tasks by an empty user defined field value.

[
  {
    "Action": "Query",
    "QueryType": "TaskNullUDFValue",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      "Exported"
    ]
  }
]

Modify Task

Add a child task to a task, and change the task's name.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Task",
    "Identity": "8",
    "Operations": [
      {
        "__operation": "CollectionAdd",
        "Collection": "ChildTasks",
        "Operations": [
          {
            "__operation": "SetProperties",
            "ApprovalRequired": false,
            "Description": "My new Task under Design",
            "Name": "NewTask8",
            "TaskCode": "NT:",
            "TimeEntryAllowed": false
          },
          {
            "__operation": "SetUdfValues",
            "Phase": "Completed"
          }
        ]
      },
      {
        "__operation": "SetProperties",
        "Name": "Special New Task Name"
      }
    ]
  }
]

Add Task Assignment

Allow a specific user, a specific department, and to enter time against a specific task.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Task",
    "Identity": "8",
    "Operations": [
      {
        "__operation": "SetAllowDepartmentAssignment",
        "Department": {
          "__type": "Replicon.Domain.Department",
          "Identity": "3"
        }
      },
      {
        "__operation": "SetAllowAllAssignment"
      },
      {
        "__operation": "SetAllowUserAssignment",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      }
    ]
  }
]

Deny Task Assignment

Deny a specific user, a specific department, and the right to enter time against a specific task.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Task",
    "Identity": "8",
    "Operations": [
      {
        "__operation": "SetDenyDepartmentAssignment",
        "Department": {
          "__type": "Replicon.Domain.Department",
          "Identity": "3"
        }
      },
      {
        "__operation": "SetDenyAllAssignment"
      },
      {
        "__operation": "SetDenyUserAssignment",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      }
    ]
  }
]

Remove Task Assignment

Remove a specific user, a specific department, and assignments from a task.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Task",
    "Identity": "8",
    "Operations": [
      {
        "__operation": "RemoveUserAssignment",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      },
      {
        "__operation": "RemoveDepartmentAssignment",
        "Department": {
          "__type": "Replicon.Domain.Department",
          "Identity": "3"
        }
      },
      {
        "__operation": "RemoveAllAssignment"
      }
    ]
  }
]

Query All Open Tasks by User

Query all the open tasks that are assigned to the given user

[
  {
    "Action": "Query",
    "QueryType": "AllOpenTasksByUser",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "45"
      }
    ]
  }
]

Query All Open Tasks by User And Project

Query all the open tasks for the given project that are assigned to the given user

[
  {
    "Action": "Query",
    "QueryType": "AllOpenTasksByUserAndProject",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "45"
      },
      {
        "__type": "Replicon.Project.Domain.Project",
        "Identity": "20"
      }
    ]
  }
]

Query Open Tasks by User and Project filtered by Task count

Query all the open tasks for the given project that are assigned to the given user. If the total number of tasks at all level are more than the exepected task count, then only the root task and it's child tasks are retrived.

[
  {
    "Action": "Query",
    "QueryType": "OpenTasksByUserAndProjectFilterByTaskCount",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "45"
      },
      {
        "__type": "Replicon.Project.Domain.Project",
        "Identity": "20"
      },
      "100"
    ]
  }
]

Query Open Tasks by User and Project filtered by Task count and Time entry date

Query all the open tasks for the given project that are assigned to the given user and the given time entry date falls in the range between task's time entry start and end date. If the total number of tasks at all level are more than the exepected task count, then only the root task and it's child tasks are retrived.

[
  {
    "Action": "Query",
    "QueryType": "OpenTasksByUserAndProjectFilterByTaskCountAndTimeEntryDate",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "45"
      },
      {
        "__type": "Replicon.Project.Domain.Project",
        "Identity": "20"
      },
      "100",
      {
        "__type": "Date",
        "Year": 2010,
        "Month": 10,
        "Day": 1
      }
    ]
  }
]

Query Open Tasks by User and parent task

Query all the open child tasks for the given parent task that are assigned to the given user

[
  {
    "Action": "Query",
    "QueryType": "AllOpenTasksByUserAndParentTask",
    "DomainType": "Replicon.Project.Domain.Task",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "45"
      },
      {
        "__type": "Replicon.Project.Domain.Task",
        "Identity": "40"
      }
    ]
  }
]