Skip to content

SelectedAction

Gets or sets the selected action for the work item.

1
 string myWorkItem.SelectedAction

Remarks

If no action is selected, this property returns null.
If the WorkItem.State is not in Waiting or Created, attempting to set this property is prohibited and throws an access denied error.
When setting this property, if the specified action is not found, a scripting error is thrown.

Reading the user action:

1
2
3
if ( $WorkItem.SelectedAction == 'Approve' ) {
   ...
}

Setting an action:

1
$WorkItem.SelectedAction = 'Approve';