Project Examples

Query Projects by Name

Query for projects by name (Our Intranet), loading the list of project team users, the project role rates, and the user's rates.

[
  {
    "Action": "Query",
    "QueryType": "ProjectByName",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      "Our Intranet"
    ],
    "Load": [
      {
        "Relationship": "ProjTeamUsers",
        "IdentityOnly": true
      },
      {
        "Relationship": "ProjectAssignedRoleRates",
        "Load": [
          {
            "Relationship": "Role",
            "IdentityOnly": true
          },
          {
            "Relationship": "Rate",
            "Load": [
              {
                "Relationship": "Entries",
                "Load": [
                  {
                    "Relationship": "Currency",
                    "IdentityOnly": true
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "Relationship": "ProjUserRateTypes",
        "Load": [
          {
            "Relationship": "TaskRate",
            "Load": [
              {
                "Relationship": "Entries",
                "Load": [
                  {
                    "Relationship": "Currency",
                    "IdentityOnly": true
                  }
                ]
              }
            ]
          },
          {
            "Relationship": "TaskRateType"
          },
          {
            "Relationship": "Role",
            "IdentityOnly": true
          },
          {
            "Relationship": "User"
          }
        ]
      }
    ]
  }
]

Query Projects by Code

Query for projects by project code, loading tasks 4 levels deep.

[
  {
    "Action": "Query",
    "QueryType": "ProjectByCode",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      "WWW"
    ],
    "Load": [
      {
        "Relationship": "Tasks",
        "Load": [
          {
            "Relationship": "ChildTasks",
            "Load": [
              {
                "Relationship": "ChildTasks",
                "Load": [
                  {
                    "Relationship": "ChildTasks"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
]

Query Projects by Id

Query for projects by Id.

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

Query by Department

Query for projects by department. An exception will be returned for this query if hierarchy filtering is not enabled.

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

Query Project by Name and Project Task Rate

Query for projects by name, and load the project rate.

[
  {
    "Action": "Query",
    "QueryType": "ProjectByName",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      "Our Intranet"
    ],
    "Load": [
      {
        "Relationship": "TaskRate"
      }
    ]
  }
]

Query Expense Projects by Current User

Query Expense Projects by Current User

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

Query Expense Projects by User Id

Query Expense Projects by User Id

[
  {
    "Action": "Query",
    "QueryType": "ExpenseProjectsByUser",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "2"
      }
    ]
  }
]

Query Expense Projects by Current User and Client Id

Query Expense Projects by Current User and Client Id

[
  {
    "Action": "Query",
    "QueryType": "ExpenseProjectsByClient",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      {
        "__type": "Replicon.Domain.Client",
        "Identity": "4"
      }
    ]
  }
]

Query Expense Projects by User Id and Client Id

Query Expense Projects by User Id and Client Id

[
  {
    "Action": "Query",
    "QueryType": "ExpenseProjectsByUserClient",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "2"
      },
      {
        "__type": "Replicon.Domain.Client",
        "Identity": "4"
      }
    ]
  }
]

Query Project by UDF Value

Query for projects by a user defined field value.

[
  {
    "Action": "Query",
    "QueryType": "ProjectEqualToUDFValue",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      "Phase",
      "Analysis"
    ]
  }
]

Query Project by Null UDF Value

Query for projects by an empty user defined field value.

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

Add Project

Create a basic project with required project-level and task-level user defined fields.

[
  {
    "Action": "Create",
    "Type": "Replicon.Project.Domain.Project",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "Test Project",
        "ProjectCode": "TP"
      },
      {
        "__operation": "SetProjectUdfValues",
        "Status": "Doomed"
      },
      {
        "__operation": "SetUdfValues",
        "Phase": "Analysis"
      }
    ]
  }
]

Edit Project

Change a project's name.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "Special New Name!"
      }
    ]
  }
]

Add Task (Shallow)

Add a task directly to a project.

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

Add Task (Deep)

Add a task to a sub-task 4 levels below the project-level in the project structure.

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

Add Task Assignment

Allow a specific user, a specific department and <all> to enter time against a project-level (root) task.

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

Remove Task Assignment

Deny a specific user, a specific department, and <all> the right to enter time against a project-level (root) task.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "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 <all> assignments from a project-level (root) task.

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

Add Project Team (All)

Assign <all> to a project team.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "SetProperties",
        "AllAssignments": true
      }
    ]
  }
]

Add Project Team (User, Department)

Add users and a department to a project team.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AddUserToProjectTeam",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      },
      {
        "__operation": "AddUserToProjectTeam",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "3"
        }
      },
      {
        "__operation": "AddDepartmentToProjectTeam",
        "Department": {
          "__type": "Replicon.Domain.Department",
          "Identity": "3"
        }
      }
    ]
  }
]

Remove Project Team (All)

Remove <all> from a project team.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "SetProperties",
        "AllAssignments": false
      }
    ]
  }
]

Remove Project Team (User, Department)

Remove a specific user and a specific department from a project team.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "RemoveUserFromProjectTeam",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      },
      {
        "__operation": "RemoveDepartmentFromProjectTeam",
        "Department": {
          "__type": "Replicon.Domain.Department",
          "Identity": "3"
        }
      }
    ]
  }
]

Remove Project Team (All Users, All Departments)

Remove all users and all departments from a project team.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "RemoveAllUsersFromProjectTeam",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      },
      {
        "__operation": "RemoveAllDepartmentsFromProjectTeam"
      }
    ]
  }
]

Add Client to Project

Create a single client project.

[
  {
    "Action": "Create",
    "Type": "Replicon.Project.Domain.Project",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "Single Project",
        "ProjectCode": "BP",
        "ClientBillingAllocationMethod": {
          "__type": "Replicon.Project.Domain.ClientBillingAllocationMethod",
          "Identity": "Single"
        }
      },
      {
        "__operation": "CollectionAdd",
        "Collection": "ProjectClients",
        "Operations": [
          {
            "__operation": "SetProperties",
            "Client": {
              "__type": "Replicon.Project.Domain.Client",
              "Identity": "4"
            }
          }
        ]
      }
    ]
  }
]

Add Client to Project (Cost Allocation)

Create a cost allocation project.

[
  {
    "Action": "Create",
    "Type": "Replicon.Project.Domain.Project",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "Cost Project",
        "ProjectCode": "BP",
        "ClientBillingAllocationMethod": {
          "__type": "Replicon.Project.Domain.ClientBillingAllocationMethod",
          "Identity": "CostAllocation"
        }
      },
      {
        "__operation": "CollectionAdd",
        "Collection": "ProjectClients",
        "Operations": [
          {
            "__operation": "SetProperties",
            "Client": {
              "__type": "Replicon.Project.Domain.Client",
              "Identity": "4"
            },
            "BillingPercentage": ".3"
          }
        ]
      },
      {
        "__operation": "CollectionAdd",
        "Collection": "ProjectClients",
        "Operations": [
          {
            "__operation": "SetProperties",
            "Client": {
              "__type": "Replicon.Project.Domain.Client",
              "Identity": "3"
            },
            "BillingPercentage": ".7"
          }
        ]
      }
    ]
  }
]

Add Client to Project (Bucket)

Create a bucket method project.

[
  {
    "Action": "Create",
    "Type": "Replicon.Project.Domain.Project",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "Bucket Project",
        "ProjectCode": "BP",
        "ClientBillingAllocationMethod": {
          "__type": "Replicon.Project.Domain.ClientBillingAllocationMethod",
          "Identity": "Bucket"
        }
      },
      {
        "__operation": "CollectionAdd",
        "Collection": "ProjectClients",
        "Operations": [
          {
            "__operation": "SetProperties",
            "Client": {
              "__type": "Replicon.Project.Domain.Client",
              "Identity": "4"
            }
          }
        ]
      },
      {
        "__operation": "CollectionAdd",
        "Collection": "ProjectClients",
        "Operations": [
          {
            "__operation": "SetProperties",
            "Client": {
              "__type": "Replicon.Project.Domain.Client",
              "Identity": "3"
            }
          }
        ]
      }
    ]
  }
]

Add Role

Add a role to a project.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AddRole",
        "ProjectRole": {
          "__type": "Replicon.Project.Domain.ProjectRole",
          "Identity": "2"
        }
      }
    ]
  }
]

Remove Role

Remove a role from a project.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "RemoveRole",
        "ProjectRole": {
          "__type": "Replicon.Project.Domain.ProjectRole",
          "Identity": "2"
        }
      }
    ]
  }
]

Remove All Roles

Remove all roles from a project.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "RemoveAllRoles"
      }
    ]
  }
]

Assign All Project Rate

Assign the project rate to <all>.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AssignAllProjectRate"
      }
    ]
  }
]

Add User Rate

Assign the default user rate and, optionally, set the rate and effective dates.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AssignUserRate",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        },
        "EffectiveDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 7,
          "Day": 15
        },
        "EndDate": {
          "__type": "Date",
          "Future": true
        },
        "HourlyRate": "99",
        "Currency": {
          "__type": "Replicon.Domain.Currency",
          "Identity": "2"
        }
      }
    ]
  }
]

Add User Rate

Add a new rate to the user rates and merge with the existing rates based on the dates specified.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AddUserRate",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        },
        "EffectiveDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 15
        },
        "EndDate": {
          "__type": "Date",
          "Future": true
        },
        "HourlyRate": "77",
        "Currency": {
          "__type": "Replicon.Domain.Currency",
          "Identity": "2"
        }
      }
    ]
  }
]

Remove User Rate

Remove a user rate from a user.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "RemoveUserRate",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      }
    ]
  }
]

Add Role Rate

Add a role rate to a user.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AssignUserRoleRate",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        },
        "ProjectRole": {
          "__type": "Replicon.Project.Domain.ProjectRole",
          "Identity": "2"
        }
      }
    ]
  }
]

Remove Role Rate

Remove a role rate from a user.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "RemoveUserRoleRate",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        },
        "ProjectRole": {
          "__type": "Replicon.Project.Domain.ProjectRole",
          "Identity": "2"
        }
      }
    ]
  }
]

Add Project Rate

Add a project rate to a user.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AssignUserProjectRate",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      }
    ]
  }
]

Remove Project Rate

Remove a project rate from a user.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "RemoveUserProjectRate",
        "User": {
          "__type": "Replicon.Domain.User",
          "Identity": "2"
        }
      }
    ]
  }
]

Add Department Rate

Add a new rate to the user rate and merge with the existing rates based on the dates specified.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "AddDepartmentRate",
        "Department": {
          "__type": "Replicon.Domain.Department",
          "Identity": "2"
        },
        "EffectiveDate": {
          "__type": "Date",
          "Year": 2010,
          "Month": 8,
          "Day": 15
        },
        "EndDate": {
          "__type": "Date",
          "Future": true
        },
        "HourlyRate": "77",
        "Currency": {
          "__type": "Replicon.Domain.Currency",
          "Identity": "2"
        }
      }
    ]
  }
]

Set User Defined Field Values

Set a user defined field value on a project-level (root) task

[
  {
    "Action": "Edit",
    "Type": "Replicon.Project.Domain.Project",
    "Identity": "1",
    "Operations": [
      {
        "__operation": "SetUdfValues",
        "Phase": "Analysis"
      }
    ]
  }
]

Query Projects for Timesheet Task Selection

Queries all the projects applicable for task selection filtering on the user's timesheet. The example query also loads the clients assigned to each project.

[
  {
    "Action": "Query",
    "DomainType": "Replicon.Project.Domain.Project",
    "QueryType": "TimesheetProjects",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "2"
      }
    ],
    "Load": [
      {
        "Relationship": "ProjectClients"
      }
    ]
  }
]

Query Projects for Timesheet Task Selection by User Id and Client Id

Queries the projects for the specified client applicable for task selection filtering on the user's timesheet. Null Value for client will return the projects having no client allocation.

[
  {
    "Action": "Query",
    "QueryType": "TimesheetProjectsByUserClient",
    "DomainType": "Replicon.Project.Domain.Project",
    "Args": [
      {
        "__type": "Replicon.Domain.User",
        "Identity": "2"
      },
      {
        "__type": "Replicon.Domain.Client",
        "Identity": "4"
      }
    ]
  }
]