How can I make a field become mandatory by another fields selection instantly in Defects?
Tags:
Question ID: 107971
1
0

Hi,

I have found and applied some code but it seems to be a bit finicky.

I want to do the following:
If Issue Type has a value of Change Request, then make the field Reason mandatory.

I have given it this code in the workflow under Bug_FieldCanChange:

If Bug_Fields("Issue Type").value="Change Request" then
Bug_fields("BG_USER_18").IsRequired=True
Else
Bug_fields("BG_USER_18").IsRequired=False

end if

BG_USER_18 = ‘Reason’ field

My main issue is that if I go from another selection in Issue Type, to "Change Request" the field does not become required instantly. You have to do something else within that defect to activate the code to work. (change any other field to something else) Which means I can now hit OK and save the defect with Change Request, and that field will not be mandatory. (no popup requiring you to input something)

Is there a way to make the change instant? Or to make this process work more efficient?

I hope I explained this well.

Marked as spam
Posted by (Questions: 2, Answers: 3)
Asked on October 30, 2017 5:30 pm
182 views
Answers (1)
1
Private answer

I have created two fields called Issue Type and Issue Description.

Issue type is a list box and it has the values called ''Something'', ''Test'', ''Test1'' and ''Test2''
Issue Description is a Edit box and not a mandatory by default.

Added the below code in the defect module workflow. One should modify the two functions with in the defect module in workflows (Bug_FieldChange & Bug_MoveTo).

Below code for reference

Sub Bug_FieldChange(FieldName)
On Error Resume Next
If Bug_Fields.Field(''BG_USER_06'').IsModified then
if Bug_Fields.Field(''BG_USER_06'').Value=''Something'' then
Bug_Fields.Field(''BG_USER_07'').IsRequired=True
Else
Bug_Fields.Field(''BG_USER_07'').IsRequired=False
End If
End If
On Error GoTo 0
End Sub

Sub Bug_MoveTo
On Error Resume Next
if Bug_Fields.Field(''BG_USER_06'').Value=''Something'' then
Bug_Fields.Field(''BG_USER_07'').IsRequired=True
Else
Bug_Fields.Field(''BG_USER_07'').IsRequired=False
End If
On Error GoTo 0
End Sub

I have refer the below article which talks about How to make specific field as mandatory in defect module.
https://community.saas.hpe.com/t5/Quality-Center-ALM-Practitioners/Hp-Defect-Module-Defect-type-specific-mandatory-Fields/td-p/1012954

Please let me know if this solves this issue?

Marked as spam
Posted by (Questions: 18, Answers: 7)
Answered on October 30, 2017 5:43 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top