Skip to content

CompletedBy

Gets the identity of the user who completed the work item.

Type

Identity

Declaration

1
readonly Identity myWorkItem.CompletedBy

Remarks

This property is populated when the work item is committed by a user. Otherwise, it returns null.

When a work item is processed by the system (through scripting or a module-type task), this property returns null.

Examples

Record who completed the previous step

1
2
3
4
5
6
var previous = $WorkItem.Previous;

if (previous && previous.CompletedBy) {
    $Xml.SetValue('Review/ReviewedBy', previous.CompletedBy.Id);
    $Xml.SetValue('Review/ReviewedByName', previous.CompletedBy.Name);
}

See Also