Sie sind auf Seite 1von 4

Workflow Example - How to Hide And/Or Remove a Defect Status in ALM v11

Summary
This workflow example demonstrates how to omit the Defect status code Reopen from the list of available status values. This example assumes you are a Project Administrator proficient with programming skills, proficient in vbscript, Quality Center objects and methods. *** It is necessary to read and accept the Disclaimer section at the end of this document. ***

Business Rules
When a user enters the Defect module, the CUST_Status list is created. The CUST_Status list is populated from the Bug Status list. All the statuses from the list Bug Status are replicated except for Reopen. To omit a different status, just replace update the v_omit_status variable with the status you wish to omit. The CUST_Status list is assigned to the Defect status field BG_STATUS when the Bug_New and Bug_MoveTo subroutines are triggered. 6) DO NOT IMPLEMENT IF USING DEFECT STATUS TRANSISITION RULES 1) 2) 3) 4) 5)

Implementation
STEP 1 Update the EnterModule Subroutine 1) 2) 3) 4) Navigate to Workflow customization Tools / Customize / Workflow / Script Editor Select the Script Editor tab. Select Project Scripts / Common Script / EnterModule subroutine. Update the subroutine with the highlighted code below.
Sub EnterModule On Error Resume Next . . . . . . If ActiveModule = "Defects" then CUST_Status_List End If . . . . . . On Error GoTo 0 End Sub

Page 1

Workflow Example - How to Hide And/Or Remove a Defect Status in ALM v11
STEP 2 Create the Following New Subroutine 1) 2) 3) 4) Navigate to Workflow customization Tools / Customize / Workflow / Script Editor Select the Script Editor tab. Select Project Scripts / Common Script. Create the CUST_Status_List subroutine with the code below in the Common Script area.

Sub CUST_Status_List v_omit_status = "Reopen" set cust = TDConnection.Customization set clists = cust.Lists set cl = clists.List("Bug Status") set root = cl.RootNode If not clists.IsListExist("CUST_Status") then clists.AddList ("CUST_Status") End If set nl = clists.List("CUST_Status") set nlroot = nl.RootNode for each child in nlroot.Children Msgbox "Remove-" & child.Name nlroot.RemoveChild(child.Name) next for each child in root.Children If Child.Name <> v_omit_status then Msgbox "Add-" & child.Name nlroot.AddChild(child.Name) End If next cust.commit Set Set Set Set Set Set cust = Nothing clists = Nothing cl = Nothing root = Nothing nl = Nothing nlroot = Nothing

End Sub

Page 2

Workflow Example - How to Hide And/Or Remove a Defect Status in ALM v11
STEP 3 Update the Bug_New Subroutine 1) 2) 3) 4) Navigate to Workflow customization Tools / Customize / Workflow / Script Editor Select the Script Editor tab. Select Project Scripts / Defects Module Script / Bug_New Update the subroutine with the highlighted code below.

Sub Bug_New Bug_Fields.Field("BG_STATUS").List = Lists("CUST_Status") . . . End Sub

STEP 4 Update the Bug_MoveTo Subroutine 1) 2) 3) 4) Navigate to Workflow customization Tools / Customize / Workflow / Script Editor Select the Script Editor tab. Select Project Scripts / Defects Module Script / Bug_MoveTo Update the subroutine with the highlighted code below.

Sub Bug_MoveTo Bug_Fields.Field("BG_STATUS").List = Lists("CUST_Status") . . . End Sub

STEP 5 Save 1) 2) 3) 4) From the Script Editor toolbar Select File / Save. Close the Script Editor Window. If prompted to save select Yes. Click the Return button to Return to Quality Center. Select Major Change if prompted. Log Out, then Log In to the Quality Center project to Test.

Keywords
Defect, Status, List, Lists, TDConnection, OTA, Workflow, Quality Center, omit, remove

Page 3

Workflow Example - How to Hide And/Or Remove a Defect Status in ALM v11 Disclaimer
While this example may meet the needs of your organization, the sole responsibility for modification and maintenance of the logic is yours and NOT that of the Support Organization. Be aware that HP Support does not provide troubleshooting support for the custom programming implemented by the customer. The decision to use the information contained herein is done at your own risk. The support organization is NOT responsible for any issues encountered as a result of implementing all or any part of the information contained or inferred herein. The intent of the information provided here is for educational purposes only. As such, the topics in this document are only guidelines NOT a comprehensive solution, as your own environment will be different. This example DOES NOT state or in any way imply that the information conveyed herein provides the solution for your environment. The appropriate system technical resources for your enterprise should perform all customization activities. Best Practice dictates NO direct changes to be made to any production environment. It is imperative to perform and thoroughly validate ALL modifications in a Test Environment. Use the results and knowledge garnered from the Test Environment experience to create a customized Production Deployment Plan for your own environment. Always ensure you have a current backup before implementing any solution.

Page 4

Das könnte Ihnen auch gefallen