Item Events
EventNames:
- AddItem_Restrictions 
- AddItem_Pre 
- AddItem_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| item | The item which should get / is added. | |
| bool | successful | Post: | 
Unexpected Behaviour
AddItem event is raised when clicking in Vault Client on New Item… -> Selecting Category -> Ok.
Therefore you have only the data about the selected Category available and seriously not more.
Examples:
AddItem_Restrictions:
Register-VaultEvent -EventName AddItem_Restrictions -Action 'RestrictAddItem'
function RestrictAddItem($item) {
	#Write event code here
}
AddItem_Pre:
Register-VaultEvent -EventName AddItem_Pre -Action 'PreAddItem'
function PreAddItem($item) {
	#Write event code here
}
AddItem_Post:
Register-VaultEvent -EventName AddItem_Post -Action 'PostAddItem'
function PostAddItem($item, $successful) {
	#Write event code here
}
EventNames:
- CommitItems_Restrictions 
- CommitItems_Pre 
- CommitItems_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| items | The items which should get / is comited. | |
| bool | successful | Post: | 
Unexpected Behaviour
CommitItems: is raised when clicking in the item dialog on Save or Save and Close.
When changing Item number via the Vault Client, the properties _Number, _NewNumber and _OldNumber have the same value.
This happens because the API call ItemService.CommitItemNumbers already changes the number on the item that is still in edit-mode.
When committing an Item which has a Comment, the properties _Comment and _OldComment will be empty because the comment will be automatically cleared from the previous API call ItemService.EditItems.
Examples:
CommitItems_Restrictions:
Register-VaultEvent -EventName CommitItems_Restrictions -Action 'RestrictCommitItems'
function RestrictCommitItems($items) {
	#Write event code here
}
CommitItems_Pre:
Register-VaultEvent -EventName CommitItems_Pre -Action 'PreCommitItems'
function PreCommitItems($items) {
	#Write event code here
}
CommitItems_Post:
Register-VaultEvent -EventName CommitItems_Post -Action 'PostCommitItems'
function PostCommitItems($items, $successful) {
	#Write event code here
}
EventNames:
- DeleteItems_Restrictions 
- DeleteItems_Pre 
- DeleteItems_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| items (deletedItems in POST) | The items which should get / are deleted. | |
| bool | successful | Post: | 
Examples:
DeleteItems_Restrictions:
Register-VaultEvent -EventName DeleteItems_Restrictions -Action 'RestrictDeleteItems'
function RestrictDeleteItems($items) {
	#Write event code here
}
DeleteItems_Pre:
Register-VaultEvent -EventName DeleteItems_Pre -Action 'PreDeleteItems'
function PreDeleteItems($items) {
	#Write event code here
}
DeleteItems_Post:
Register-VaultEvent -EventName DeleteItems_Post -Action 'PostDeleteItems'
function PostDeleteItems($deletedItems, $successful) {
	#Write event code here
}
EventNames:
- EditItems_Restrictions 
- EditItems_Pre 
- EditItems_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| items | The items which should get / are in edit mode. | |
| bool | successful | Post: | 
Unexpected Behaviour
The EditItems event is raised when:
- clicking on Open -> Edit or directly “Update “for the item. 
- clicking on Save (not save and close) in the dialog then first CommitItem is fired, and then EditItem 
- activating in the the Bill of Materials Tab of the Item dialog a new item 
Examples:
EditItems_Restrictions:
Register-VaultEvent -EventName EditItems_Restrictions -Action 'RestrictEditItems'
function RestrictEditItems($items) {
	#Write event code here
}
EditItems_Pre:
Register-VaultEvent -EventName EditItems_Pre -Action 'PreEditItems'
function PreEditItems($items) {
	#Write event code here
}
EditItems_Post:
Register-VaultEvent -EventName EditItems_Post -Action 'PostEditItems'
function PostEditItems($items, $successful) {
	#Write event code here
}
EventNames:
- PromoteItems_Restrictions 
- PromoteItems_Pre 
- PromoteItems_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| files | The files which should get / are assigned to the items. | |
| items | The items which should get / are assigned to the files. | |
| bool | successful | Post: | 
Unexpected Behaviour
PromoteItems event is raised when clicking “Assign / Update Item” on a file or “Update…” on a item and afterwards EditItem event is fired
- When “Assign / Update Item” on a file is clicked wheter the item exists or not, you will only get data about the files 
- When “Update…” on an item is clicked, you will only get data about the items 
- Changing item category does not fire any event. 
Examples:
PromoteItems_Restrictions:
Register-VaultEvent -EventName PromoteItems_Restrictions -Action 'RestrictPromoteItems'
function RestrictPromoteItems($files, $items) {
	#Write event code here
}
PromoteItems_Pre:
Register-VaultEvent -EventName PromoteItems_Pre -Action 'PrePromoteItems'
function PrePromoteItems($files, $items) {
	#Write event code here
}
PromoteItems_Post:
Register-VaultEvent -EventName PromoteItems_Post -Action 'PostPromoteItems'
function PostPromoteItems($files, $items, $successful) {
	#Write event code here
}
EventNames:
- UpdateItemStates_Restrictions 
- UpdateItemStates_Pre 
- UpdateItemStates_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| items | The Items in Vault for which the lifefycle status changes/was changed. | |
| bool | successful | Post: | 
Examples:
UpdateItemStates_Restrictions:
Register-VaultEvent -EventName UpdateItemStates_Restrictions -Action 'RestrictUpdateItemStates'
function RestrictUpdateItemStates($items) {
	#Write event code here
}
UpdateItemStates_Pre:
Register-VaultEvent -EventName UpdateItemStates_Pre -Action 'PreUpdateItemStates'
function PreUpdateItemStates($items) {
	#Write event code here
}
UpdateItemStates_Post:
Register-VaultEvent -EventName UpdateItemStates_Post -Action 'PostUpdateItemStates'
function PostUpdateItemStates($items, $successful) {
	#Write event code here
}
EventNames:
- RollbackItemState_Restrictions 
- RollbackItemState_Pre 
- RollbackItemState_Post 
Parameters
| Type | Name | Description | 
|---|---|---|
| item | The item which should get / is reverted for a LifeCycle. | |
| bool | successful | Post: | 
Examples:
RollbackItemState_Restrictions:
Register-VaultEvent -EventName RollbackItemState_Restrictions -Action 'RestrictRollbackItemState'
function RestrictRollbackItemState($item) {
	#Write event code here
}
RollbackItemState_Pre:
Register-VaultEvent -EventName RollbackItemState_Pre -Action 'PreRollbackItemState'
function PreRollbackItemState($item) {
	#Write event code here
}
RollbackItemState_Post:
Register-VaultEvent -EventName RollbackItemState_Post -Action 'PostRollbackItemState'
function PostRollbackItemState($item, $successful) {
	#Write event code here
}