This is a technical entry with my research-and-experiment notes. Feel free to add or argue. Try at your own risk.
I continue my study journal figuring out HP ALM configuration. This is a second entry about customization with VBScript.
General Idea
Typical issue / defect management workflow is based on rules specific to the Role and State. For example, Developer may set issue state to Fixed, but cannot set it to Verified, while it’s vice versa for Tester. HP ALM has a built-in option for 2-step dependencies (mentioned here). For more complex rules administrators need to use VBScript for real-time customization.
Note that there are two particular challenges:
- As transition rules are different for different Roles, contents of dropdowns must change dynamically. You’ll need to have different Project Lists to be pre-defined.
- Setting lists’ options and list items should be done on the fly and support reverse of selection before changes have been submitted. I.e. when the user changes status from Open to Closed she gets one set of lists’ options, but she should be able to change it back or to something else, while staying in the same window. For that purpose, an extra field could be used to store a ‘base’ status.
Code Examples
Storing Status
Sub Template_Bug_MoveTo On Error Resume Next Template_WizardFieldCust_Details ' Added by wizard 'store BaseResolution Bug_Fields("BG_USER_TEMPLATE_19").Value = Bug_Fields("BG_USER_TEMPLATE_14").Value 'store BaseStatus Bug_Fields("BG_USER_TEMPLATE_18").Value = Bug_Fields("BG_STATUS").Value '... End Sub
Conditional Rules
Sub Template_Bug_FieldChange(FieldName) '... On Error Resume Next 'special setup for Test group If User.IsInGroup("Testers") Then 'Status If FieldName= "BG_STATUS" then 'Closed If Bug_Fields("BG_STATUS").Value = "Closed" Then If Bug_Fields("BG_USER_TEMPLATE_18").Value = "Open" Then 'Resolution Bug_Fields("BG_USER_TEMPLATE_14").Value = "Revisit In Future" Bug_Fields("BG_USER_TEMPLATE_14").List = Lists("lstResolution_Closed1") End If If Bug_Fields("BG_USER_TEMPLATE_18").Value = "Verified" Then 'Resolution Bug_Fields("BG_USER_TEMPLATE_14").Value = "Passed" Bug_Fields("BG_USER_TEMPLATE_14").List = Lists("lstResolution_Passed") End If If Bug_Fields("BG_USER_TEMPLATE_18").Value = "Reopen" Then 'Resolution Bug_Fields("BG_USER_TEMPLATE_14").Value = "Revisit In Future" Bug_Fields("BG_USER_TEMPLATE_14").List = Lists("lstResolution_Closed1") End If End If 'Reopen If Bug_Fields("BG_STATUS").Value = "Reopen" Then If Bug_Fields("BG_USER_TEMPLATE_18").Value = "Closed" Then 'Resolution Bug_Fields("BG_USER_TEMPLATE_14").Value = "To Be Reviewed" Bug_Fields("BG_USER_TEMPLATE_14").List = Lists("lstResolution_TBR") End If If Bug_Fields("BG_USER_TEMPLATE_18").Value = "Ready For Testing" Then 'Resolution Bug_Fields("BG_USER_TEMPLATE_14").Value = "Failed" Bug_Fields("BG_USER_TEMPLATE_14").List = Lists("lstResolution_Failed") End If End If '... End If '... End Sub