Share via


EntityType: Assignment (ProjectData service)

In this article
Definition
Parent element
Child elements

Contains properties that define the reporting data for an assignment in the ProjectData service.

Example

The following REST query uses the Assignments entity set and the ResourceName property to get the IDs of all assignments that have unassigned resources. The query is all on one line.

https://<pwa_url>/_api/ProjectData/Assignments
    ?$filter=ResourceName eq 'Unassigned Resource'
    &$select=AssignmentId

The following statement uses LINQ query syntax to retrieve Assignment entity data from the OData interface of the Project Server reporting tables. To use the statement in an application, set a service reference to the ProjectDataService, and initialize the ReportingData context. The Assignments entity set can then be accessed as context.Assignments. For more information, see Querying OData feeds for Project 2013 reporting data.

var query =
    from a in Assignments
    orderby a.ProjectName, a.ResourceName
    select new
    {
        Project = a.ProjectName,
        Resource = a.ResourceName,
        AssignmentBookingType = a.AssignmentBookingName,
        AssignmentStartDate = a.AssignmentStartDate,
        Task = a.TaskName,
        AssignmentWork = a.AssignmentWork,
        AssignmentCost = a.AssignmentCost,
        AssisgnmentCostVariance = a.AssignmentCostVariance,
        AssignmentFinishVariance = a.AssignmentFinishVariance
    };

The preceding statement can be written by using Lambda expression syntax, as follows:

var query = Assignments
    .OrderBy(a => a.ProjectName)
    .ThenBy(a => a.ResourceName)
    .Select(a => new
    {
        Project = a.ProjectName,
        Resource = a.ResourceName,
        AssignmentBookingType = a.AssignmentBookingName,
        AssignmentStartDate = a.AssignmentStartDate,
        Task = a.TaskName,
        AssignmentWork = a.AssignmentWork,
        AssignmentCost = a.AssignmentCost,
        AssisgnmentCostVariance = a.AssignmentCostVariance,
        AssignmentFinishVariance = a.AssignmentFinishVariance
    });

Either statement creates the following REST URL (all on one line).

http://<pwa_url>/_vti_bin/client.svc/ProjectData/Assignments
    ?$orderby=ProjectName,ResourceName
    &$select=ProjectName,ResourceName,AssignmentBookingName,AssignmentStartDate,TaskName,
    AssignmentWork,AssignmentCost,AssignmentCostVariance,AssignmentFinishVariance

All three of the sample queries get the same data.

Sample results of the Task query

Project

Resource

AssignmentBookingType

AssignmentStartDate

Task

AssignmentWork

AssignmentCost

AssignmentCostVariance

AssignmentFinishVariance

ProjectA

Res2

Committed

3/12/2012 8:00:00 AM

T1

24.0 hrs

$404.00

$0.00

0.0 hrs

ProjectA

Res7

Committed

3/12/2012 8:00:00 AM

T3

32.0 hrs

$564.00

$136.00

8.0 hrs

ProjectA

Res8

Committed

3/12/2012 8:00:00 AM

T2

8.0 hrs

$156.00

-$272.00

-16.0 hrs

ProjectB

Res3

Committed

3/19/2012 8:00:00 AM

T3

40.0 hrs

$740.00

$0.00

0.0 hrs

ProjectB

Res4

Proposed

3/19/2012 8:00:00 AM

T4

8.0 hrs

$168.00

-$168.00

-8.0 hrs

ProjectB

Res7

Committed

3/19/2012 8:00:00 AM

T1

48.0 hrs

$836.00

$272.00

16.0 hrs

ProjectB

Res8

Committed

3/19/2012 8:00:00 AM

T2

24.0 hrs

$428.00

$0.00

0.00

Definition

<EntityType Name="Assignment">
  <Key>
    <PropertyRef Name="AssignmentId" />
    <PropertyRef Name="ProjectId" />
  </Key>
  <Property Name="ProjectId" Type="Edm.Guid" Nullable="false" />
. . .
  <NavigationProperty Name="Baseline" Relationship="ReportingData.AssignmentBaseline_Assignment_Assignment_Baseline" ToRole="AssignmentBaseline_Assignment" FromRole="Assignment_Baseline" />
 . . .
</EntityType>

Parent element

Element

Description

ReportingData

The schema for the reporting data in the ProjectData service.

Child elements

Child elements are properties of an assignment and navigation properties of that assignment. Attributes of the Property elements specify the property name and type, and whether the property can be a null value. The NavigationProperty elements specify collections of entities, such as baselines and resources, that are associated with an assignment. A navigation property uses an Association element in a query for a related entity or collection

The Key elements specify the properties that are the primary keys for an assignment query. ProjectId is the project GUID and AssignmentId is the GUID of the assignment.

Property elements

The following table lists the values of the Property elements for the Assignment entity. The Name, Type, and Nullable columns contain attribute values for each property.

Attribute values for the Property elements of Assignment

Name

Type

Nullable

Description

AssignmentActualCost

Edm.Decimal

true

The costs incurred for work already performed on an assignment, along with any other associated costs.

AssignmentActualFinishDate

Edm.DateTime

true

The date and time when an assignment was actually completed.

AssignmentActualOvertimeCost

Edm.Decimal

true

The costs incurred for overtime work already performed on an assignment.

AssignmentActualOvertimeWork

Edm.Decimal

true

The actual amount of overtime work already performed on an assignment.

AssignmentActualRegularCost

Edm.Decimal

false

The cost of the total non-overtime work already performed on an assignment.

AssignmentActualRegularWork

Edm.Decimal

false

The total amount of non-overtime work already performed on an assignment.

AssignmentActualStartDate

Edm.DateTime

true

The date and time that the assignment actually began.

AssignmentActualWork

Edm.Decimal

true

The amount of work that has already been performed on an assignment.

AssignmentACWP

Edm.Decimal

true

The costs incurred for work already performed on an assignment, up to the project status date or today's date.</td>

AssignmentBCWP

Edm.Decimal

true

The budgeted cost of work performed on an assignment that is scheduled, up to the status date or today’s date.

AssignmentBCWS

Edm.Decimal

true

The budgeted cost of work scheduled, up to the status date or today’s date.

AssignmentBookingDescription

Edm.String

true

The text description of the booking type.

AssignmentBookingId

Edm.Int32

false

The integer constant that represents the assignment booking type. For more information, see the Microsoft.Office.Project.Server.Library.Resource.BookingType enumeration.

AssignmentBookingName

Edm.String

true

The assignment booking name (committed or proposed).

AssignmentBudgetCost

Edm.Decimal

false

The total scheduled or projected cost for an assignment.

AssignmentBudgetMaterialWork

Edm.Decimal

false

The total scheduled or projected use of equipment, supplies, or other consumable items for an assignment.

AssignmentBudgetWork

Edm.Decimal

false

The total amount of work originally planned for an assignment.

AssignmentCost

Edm.Decimal

true

The total cost for an assignment, based on costs already incurred, in addition to costs planned for the remaining work.

AssignmentCostVariance

Edm.Decimal

true

The difference between the baseline cost of an assignment and the total cost for work already performed, in addition to work remaining.

AssignmentCreatedDate

Edm.DateTime

false

The date and time that the assignment was created.

AssignmentCreatedRevisionCounter

Edm.Int32

false

The number of times that the assignment has been revised. When the assignment is created, the AssignmentCreatedRevisionCounter = 1.

AssignmentCV

Edm.Decimal

true

The difference between how much it should have cost to achieve the current level of completion on the assignment and how much it has actually cost to achieve the current level of completion, up to the status date or today's date.

AssignmentDelay

Edm.Decimal

true

The amount of time beyond the start date that an assignment is allowed to start.

AssignmentFinishDate

Edm.DateTime

true

The date and time that the assignment is completed.

AssignmentFinishVariance

Edm.Decimal

true

The difference between an assignment's baseline finish date and its scheduled finish date.

AssignmentId

Edm.Guid

false

Key
The GUID that identifies the assignment.

AssignmentIsOverallocated

Edm.Boolean

false

Indicates whether the resource is assigned to more work on this assignment than can be done within the resource's normal working capacity.

AssignmentIsPublished

Edm.Boolean

false

Indicates whether the assignment is published.

AssignmentMaterialActualWork

Edm.Decimal

true

The actual work for a material resource, usually expressed as a percentage.

AssignmentMaterialWork

Edm.Decimal

true

The total time scheduled for a material resource.

AssignmentModifiedDate

Edm.DateTime

false

The date and time that the assignment was modified

AssignmentModifiedRevisionCounter

Edm.Int32

false

Keeps track of the number of times that the assignment has been modified. When the assignment is created, the AssignmentModifiedRevisionCounter = 1.

AssignmentOvertimeCost

Edm.Decimal

true

The total overtime cost for an assignment, including costs for overtime work already performed, in addition to remaining overtime work.

AssignmentOvertimeWork

Edm.Decimal

true

The amount of overtime work that is scheduled to be performed on an assignment.

AssignmentPeakUnits

Edm.Decimal

true

The maximum percentage or number of units for which a resource is assigned at any one time for tasks.

AssignmentPercentWorkCompleted

Edm.Int16

true

The current status of an assignment, expressed as the percentage of work that has been completed.

AssignmentRegularCost

Edm.Decimal

false

The cost fields show the total scheduled or projected cost for an assignment, based on costs already accrued, in addition to costs planned for the remaining work.

AssignmentRegularWork

Edm.Decimal

false

The total amount of regular (nonovertime) work that is scheduled to be performed on the assignment.

AssignmentRemainingCost

Edm.Decimal

false

The remaining scheduled expense that will be incurred by completing the remaining work on the assignment.

AssignmentRemainingOvertimeCost

Edm.Decimal

false

The remaining scheduled overtime expense for an assignment.

AssignmentRemainingOvertimeWork

Edm.Decimal

false

The amount of remaining scheduled overtime work on the assignment.

AssignmentRemainingRegularCost

Edm.Decimal

false

The remaining scheduled expense that will be incurred by completing the remaining scheduled regular (nonovertime) work for an assignment.

AssignmentRemainingRegularWork

Edm.Decimal

false

The amount of time, such as person-hours or days, that is still required to complete the regular (nonovertime) work for an assignment.

AssignmentRemainingWork

Edm.Decimal

false

The amount of time, such as person-hours or days, that is still required to complete both regular and overtime work for an assignment.

AssignmentResourcePlanWork

Edm.Decimal

false

The total time scheduled for the assignment in the resource plan.

AssignmentResourceType

Edm.Int16

true

The type of resource that is associated with an assignment. For more information, see the Microsoft.Office.Project.Server.Library.Resource.Type enumeration.

AssignmentStartDate

Edm.DateTime

true

The date when a resource is scheduled to begin working on an assignment.

AssignmentStartVariance

Edm.Decimal

true

The difference between an assignment's baseline start date and its currently scheduled start date.

AssignmentSV

Edm.Decimal

true

The SV (earned value schedule variance) field shows the difference in cost terms between the current progress and the baseline plan for an assignment, up to the status date or today's date.

AssignmentType

Edm.Int32

false

Type of the assignment. NormalAssignment=0, WorkOnlyAssignment=1, FixedCostAssignment=2, FixedCostWorkOnlyAssignment=3, EmptyAssignment=4, FixedCostGeneratedAssignment=100 (generated during RDS transfer), ResourcePlanAssignment=101.

AssignmentVAC

Edm.Decimal

true

The variance at completion (VAC) between the baseline cost and the total cost for an assignment.

AssignmentWork

Edm.Decimal

true

The total amount of time that is scheduled for an assignment.

AssignmentWorkVariance

Edm.Decimal

true

The difference between the originally planned baseline work on an assignment and the currently scheduled work.

CostType_R

Edm.String

true

The CostType assignment custom field, which is rolled down from the resource custom field value.

Health_T

Edm.String

true

The Health assignment custom field, which is rolled down from the task custom field value.

IsPublic

Edm.Boolean

false

Specifies whether the assignment is published.

ProjectId

Edm.Guid

true

Key
The GUID that identifies the project in which the assignment occurs.

ProjectName

Edm.String

true

The name of the project.

RBS_R

Edm.String

true

The (RBS) assignment custom field, which is rolled down from the resource custom field.

ResourceDepartments_R

Edm.String

true

The ResourceDepartments assignment custom field, which is rolled down from the resource custom field.

ResourceId

Edm.Guid

false

The GUID that identifies the resource for the assignment.

ResourceName

Edm.String

true

The name of the resource for the assignment.

TaskId

Edm.Guid

false

The GUID that identifies the task that the assignment is for.

TaskIsActive

Edm.Boolean

false

True if the task is active.

TaskName

Edm.String

true

The name of the task that the assignment is for.

TimesheetClassId

Edm.Guid

true

The GUID that identifies the timesheet class for the assignment.

TypeDescription

Edm.String

true

The description of the assignment type.

TypeName

Edm.String

true

The name of the assignment type. See the Microsoft.Office.Project.Server.Library.Reporting.AssignmentType enumeration.

Note

The Property elements table includes only the default assignment custom fields: CostType_R, Health_T, RBS_R, and ResourceDepartments_R. If you create a resource custom field or a task custom field that rolls down to assignments, the ReportingData schema for the Assignment entity type would contain an additional property for each new custom field. For example, if you create a resource custom field named Test Res that rolls down, the Assignment entity type would include the TestRes_R property for that assignment custom field.

The following table lists attribute values for the NavigationProperty elements of the Assignment entity. The Name and Relationship columns contain attribute values for each navigation property.

Each Relationship attribute has two pairs of names; each pair of names indicates a navigation direction. The first pair starts with the entity type that has the primary, or starting, role in the navigation. The second pair starts with the entity type that has the secondary, or dependent, role in the navigation. For example, for the Baseline navigation property, the primary type is AssignmentBaseline, and the secondary type is Assignment. For this type of navigation, the FromRole is Assignment_Baseline, and the ToRole is AssignmentBaseline_Assignment.

Attribute values for the NavigationProperty elements

Name

Relationship

Description

Baseline

AssignmentBaseline_Assignment_Assignment_Baseline

Establishes navigation from a collection of assignment baselines to an assignment and from an assignment to a baseline.

Project

Project_Assignments_Assignment_Project

Establishes navigation from a project to a collection of assignments and from an assignment to a project.

Resource

Assignment_Resource_Resource_Assignments

Establishes navigation from a collection of assignments to a resource and from a resource to a collection of assignments.

Task

Assignment_Task_Task_Assignments

Establishes navigation from a collection of assignments to a task and from a task to a collection of assignments.

TimephasedData

AssignmentTimephasedData_Assignment_Assignment_TimephasedData

Establishes navigation from a collection of assignment timephased data to an assignment and from an assignment to timephased data.

See also

Reference

Assignments

ReportingData

Concepts

Querying OData feeds for Project 2013 reporting data