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

Re: QC 11 Workflow Issue

$
0
0

I checked for what you have asked, but couldn't find the error.

 

 

 

the issue is i guess the value in the bug status filed is not being read and everytime QC is taking the status as blank, that's why i am getting the msgbox:The initial value will be set to new.

 

Here is the code for Bug field can change and Last value function(it returns the last value stored in BUG Status Field)

 

Function Bug_FieldCanChange(FieldName, NewValue)
  On Error Resume Next
    Dim fieldPrevValue:fieldPrevValue = LastValue("BG_STATUS", "Defects")
    Bug_FieldCanChange = True
    If FieldName = "BG_STATUS" then
      select CASE fieldPrevValue
        case ""
          select case NewValue
           case "New"
           case else
             Bug_FieldCanChange = False
             MsgBox "The initial value will be set to 'New'"
             NewValue = fieldPrevValue
             Bug_Fields("BG_STATUS").Value = "New"
          end select

 

 

Function LastValue(FieldName, Entity)
         'This function returns the value of the field before the user changes it.
         'FieldName - Name of field for which you are looking
         'Entity - Name of the Entity affected
         On Error Resume Next

         dim com
         dim rec
         dim td

         'If the Entity is a Defect entity
         if Entity = "Defects" then
            'If the bug is new then the previous value is Null
            if Bug_Fields("BG_BUG_ID").IsNull then
               LastValue =""
               exit function
            end if
         end if

         set td = TDConnection
         set com = td.Command

         'Run SQL query to return the previous value
         select case Entity

            case "Requirements"
               com.CommandText = "select " & FieldName & " from REQ where RQ_REQ_ID=" & Req_Fields("RQ_REQ_ID").Value
            case "Test"
               com.CommandText = "select " & FieldName & " from TEST where TS_TEST_ID=" & Test_Fields("TS_TEST_ID").Value
            case "Design Steps"
               com.CommandText = "select " & FieldName & " from DESSTEPS where DS_TEST_ID=" & DesignStep_Fields("DS_TEST_ID").Value & _" and DS_STEP_ID=" & DesignStep_Fields("DS_STEP_ID").Value
            case "Test Set"
               com.CommandText = "select " & FieldName & " from CYCLE where CY_CYCLE_ID=" & TestSet_Fields("CY_CYCLE_ID").Value
            case "Test in Test Set"
               com.CommandText = "select " & FieldName & " from TESTCYCL where TC_CYCLE_ID=" & TestSetTest_Fields("TC_CYCLE_ID").Value & _" and TC_TEST_ID=" & TestSetTest_Fields("TC_TEST_ID").Value & _" and TC_TEST_INSTANCE=" & TestSetTest_Fields("TC_TEST_INSTANCE").Value
            case "Run"
               com.CommandText = "select " & FieldName & " from RUN where RN_RUN_ID=" & Run_Fields("RN_RUN_ID").Value
             case "Steps"
                com.CommandText = "select " & FieldName & " from STEP where ST_RUN_ID=" & Step_Fields("ST_RUN_ID").Value & _" and ST_STEP_ID=" & Step_Fields("ST_STEP_ID").Value
            case "Defects"
               com.CommandText = "select " & FieldName & " from BUG where BG_BUG_ID=" & Bug_Fields("BG_BUG_ID").Value

         end select

         set rec = com.Execute
         rec.First

         LastValue = rec.FieldValue(Cstr(FieldName))
         set com = nothing
         set rec = nothing

         On Error GoTo 0

End Function

 

 

 

can you please look into it?


Viewing all articles
Browse latest Browse all 14708

Trending Articles



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