| || |
HP ALM OTA - Updating a field with an associated customization list
I'm using HP OTA with the following environment:
ALM Version: 11.0
Dev environment : Visual Studio 2010 (VB.NET)
I'm trying to update a defect field (CLOSED_IN_VERSION) which is associated with a customization list (VERSIONS) but have been unsuccessful so far. I know the name and ID of the customization list. I have already tried the following options:
(Assuming that objBug is the bug object)
1. Update the defect field directly with the string value like below
objBug.Field("BG_USER_05") = "Coding Standard"
but this fails with a message "Field < BG_USER_05 > requires a value from the corresponding list"
2. Update the defect field with the ID of the list item from the customization list like below
objBug.Field("BG_USER_05") = custList.RootNode.Children(i).ID
(where custList contains the 'Versions' list object from the bug factory)
but I get the same error as before
3. Update the defect field with the entire List Item (of type Object) object like below:
objBug.Field("BG_USER_05") = custList.RootNode.Children(i)
Here too I get the same error as before
Any help in solving this will be greatly appreciated. Thank you!
Did you copy (outline, ctrl-c) the acceptable value from the table and paste it in between the quotes? I believe that's what i had to do, although it was several years ago.
I did. I retrieved the item value from the list item using the BugFactory -> Field -> CustomizationList -> RootNode -> Children(i).Name
Originally Posted by AlexAms
That didn't work either
What about a direct read with a like:
Update XXX, YYY
"ABC", (select bugfactory.field.custlink.bug.field where bugfactory.field.custlink.bug.field like "Wanted val")
This should work as long as the Wanted Val is distingishable from all others in list.
I can dig through some older sqls and try to find an example if you would like.
You need to check what the default list assigned to that field is. If the list you are looking at for the values is assigned in workflow and the values differ from the default list then you will get this error.
Ok I'll try this. If you can find an example, that would be great! Thanks!
Originally Posted by AlexAms
So, from this I understand that - based on what stage of the workflow the defect is in, the values in the field are bound to change; is that right? I checked that but that's not the case. For example: When I'm trying to update the defect from an 'Open' to 'Fixed' state, I'm assigning the value of 'Root Cause' as 'Coding Standard' which is very much available when I do this process manually. However, when I try to do the same through OTA, I get the error
Originally Posted by brendan_dick
Workflow doesn't run when you change something via the OTA API. You need to check what the default list assigned to that field is as that is the list that will be assigned when you try to update through the OTA API.