SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    remove requirement to requirement traces

    Hi

    i'm trying to create a piece of code through the API to remove all exisitng requirement to requirement traceability within a project for a certain requirement type

    the code i have below works for adding tracebility between requirements if i replace 'RemoveItem' with 'AddItem' so i cant work out why the remove doesnt work?



    CODE
    Set reqFact = QCConnection.ReqFactory
    Set r_filter = reqFact.Filter

    r_filter.Filter("RQ_TYPE_ID") = "Undefined"

    Set ReqList = r_filter.NewList 'Get a list of all the Reqs

    For Each r In ReqList
    'MsgBox "requirement id returned is " & r.Field("RQ_REQ_ID")
    reqID = r.Field("RQ_REQ_ID")
    ' MsgBox reqID

    Set reqListFrom = reqFact.GetTracedList(reqID, 0)


    For Each rtFrom In reqListFrom
    r.ReqTraceFactory(0).RemoveItem (rtFrom.Field("RQ_REQ_ID"))
    Next


    Next


    many thanks in advance

  2. #2
    Advanced Member cgrzelka's Avatar
    Join Date
    Feb 2005
    Location
    Bordeaux, France
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remove requirement to requirement traces

    Rich, I gave you some code to try on the other forum. If it works, I'll publish it here as well.

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remove requirement to requirement traces

    Hi Christian

    sorry for the delay in posting to this, it worked! i wasn't passing an object reference in for the code i had....

    thanks very much

  4. #4
    Advanced Member cgrzelka's Avatar
    Join Date
    Feb 2005
    Location
    Bordeaux, France
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: remove requirement to requirement traces

    Here is the code that worked :
    <font class="small">Code:</font><hr /><pre>
    Const TDOLE_TRACED_FROM = 0
    Const TDOLE_TRACED_TO = 1
    ' Get the requirement factory
    Set reqFact = QCConnection.ReqFactory
    ' Get the filter for that factory
    Set reqFilter = reqFact.Filter
    ' Filter on Undefined requirement type (or, to test on a subset, filter here on a req ID)
    reqFilter.Filter ("RQ_REQ_TYPE") = "Undefined"
    ' Get the list of requirements from that filter
    Set reqList = reqFilter.NewList
    ' Loop through each requirement
    For Each rq In reqList
    ' For each requirement, get the "Traced From" link factory
    Set reqTraceFact = rq.ReqTraceFactory (TDOLE_TRACED_FROM)
    ' Get the list of all requirements linked to this one
    Set reqTraceList = reqTraceFact.NewList("")
    ' Delete them with only one statement
    reqTraceFact.RemoveItem reqTraceList
    ' Clean up
    Set reqTraceList = Nothing
    Set reqTraceFact = Nothing
    Next
    ' Clean up
    Set reqList = Nothing
    Set reqFilter = Nothing
    Set reqFact = Nothing
    </pre><hr />

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:10 AM.

Copyright BetaSoft Inc.