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

Get the current requirement ID within workflow script using the OTA API

$
0
0

Hi all.

 

I am trying to get the requirement ID of the requirement the user just changed through the Req_FieldChange script in the workflow requirements module.

 

I thought I would get this through getting an instance of a requirements factory and then getting a "newlist" on it

 

This does not appear to be working. Here is my code.

 

Incidentally the objective here is to populate a field based on the value of several other fields, hence the large case statement in the SQL.

 

This SQL runs fine but it returns the root of the requirements tree, because I am not passing it a where clause to limit the results.

 

Sub Req_FieldChange(FieldName)
  On Error Resume Next
   if FieldName = "RQ_USER_18" then
     dim com
     dim rec
     dim td
     dim msg
     dim lst
     set td = TDConnection
     set com = td.Command


     set ReqF = td.ReqFactory 

     set msg = ReqF.Newlist


     MsgBox ("The Requirement is " & msg)

     com.CommandText = "SELECT RQ_REQ_NAME, RQ_USER_18 as ASSESSMENT_STATUS,RQ_USER_10 AS SSWG_STATUS,RQ_USER_13 AS PACKAGING_STATUS,RQ_USER_17 as TESTING_STATUS, CASE WHEN (RQ_USER_17 IS NULL OR RQ_USER_17 = 'Testing Failed') THEN CASE WHEN (RQ_USER_13 IS NULL OR RQ_USER_13 = 'Packaging Failed') THEN CASE WHEN (RQ_USER_10 IS NULL OR RQ_USER_10 = 'Rejected By SSWG') THEN CASE WHEN (RQ_USER_18 IS NULL OR RQ_USER_18 = 'ASSESSMENT FAILED') THEN 'WE DONT **bleep**ING KNOW' ELSE RQ_USER_18 END ELSE RQ_USER_10 END ELSE RQ_USER_13 END ELSE RQ_USER_17 END AS RESULT FROM REQ"
     set rec = com.Execute
     msg = rec.fieldValue(RESULT)
     MsgBox ("The Calculated Status is" & msg)
     set com = nothing
     set rec = nothing
     set td = nothing
   end if
  On Error GoTo 0
End Sub


Viewing all articles
Browse latest Browse all 14708

Trending Articles



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