-
Looking to use VenafiPS to configure a custom field's list options. Basically want a custom field thats pulling a list from another source so will be somewhat dynamic as in adding a new option from time to time. For testing I have a new custom field named 'TestField' with 3 options. As I didn't see an Update Custom Field built-in functionality I'm trying to use the Invoke-VenafiRestAPI method to interact with the Metadata/UpdateItem endpoint as follows: I've also tried taking it as pure JSON and then converting it to a PS Hash Table.
Both methods I end up with the same error: Metadata item has invalid values. The update Data is missing. False 15 If I look at my $hashtable, it appears to have the Data field added correctly.
Value Test Help Message |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @tonyb2BB, you were close, but I see 2 issues. The first code, The following worked for me to update list options, |
Beta Was this translation helpful? Give feedback.
Hi @tonyb2BB, you were close, but I see 2 issues. The first code,
Invoke-VenafiRestMethod -Method Post -UriLeaf 'Metadata/UpdateItem' -Body @{'Update' = @{'DN' = '\VED\Metadata Root\TestField'; 'Data' = @{'Name' = 'ErrorMessage'; 'Value' = 'Test Help Message'}}}
has Data as a hashtable when it should be an array of hashtables (it looks like you fixed this in your second try). Also, a list type doesn't have an error message, only a string does when performing validation. When I try and update ErrorMessage for a list field I get a 400.The following worked for me to update list options,
Invoke-VenafiRestMethod -UriLeaf 'Metadata/UpdateItem' -Body @{'Update'=@{'DN'='\VED\Metadata Root\bb1639…