Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Make a field mandatory when the test is in Failed or Not Completed status

$
0
0

Hello,

 

I am trying to put in a workflow script that makes a particular field in the test lab (TC_USER_07) mandatory if the test is in Failed or Not Completed status.

 

I wrote a bit of code (may be dirty) and it is working for me to some extend:

 

Sub TestSetTests_FieldChange(FieldName)

On Error Resume Next

If (FieldName = "TC_STATUS") Then
If (TestSetTest_Fields.Field("TC_STATUS").Value = "Failed" or TestSetTest_Fields.Field("TC_STATUS").Value = "Not Completed") Then
TestSetTest_Fields.Field("TC_USER_07").IsRequired = True
Else
TestSetTest_Fields.Field("TC_USER_07").IsRequired = False
End if
End if

On Error GoTo 0
End Sub

 

The above script is to handle this case when the test status is changed to Failed via fast run.


Sub TestSetTests_MoveTo
On Error Resume Next

If (TestSetTest_Fields.Field("TC_STATUS").Value = "Failed" or TestSetTest_Fields.Field("TC_STATUS").Value = "Not Completed") Then
TestSetTest_Fields.Field("TC_USER_07").IsRequired = True
TestSetTest_Fields.Field("TC_PLAN_SCHEDULING_DATE").Value = TestSetTest_Fields.Field("TC_EXEC_DATE").Value
Else
TestSetTest_Fields.Field("TC_USER_07").IsRequired = False
End If

On Error GoTo 0
End Sub

 

The above script is to handle this case when the test status is changed to Failed via manual run.

 

 

Now, coming to my question..

 

The above script does not give me best results when I try to filter the tests in the test set by No Run status and then fail it one by one.

 

Can someone please suggest a better way of implementing this?

 

Thanks,

Jyothis.


Viewing all articles
Browse latest Browse all 14708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>