SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Oct 2007
    Location
    TN, India
    Posts
    66
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Changing the Status of all the Child Requirements

    Hello All,

    Is there any table in QC refering the child requirements and sub child requirements for each parent requirement.


    Actually the issue for me is when a Parent Requirement status is changed to 'X' then the value of the child Requirements(including its sub-child/grant-child requirement) status should also be changed to the same 'X'.

    I had done for the one level child and i need the logic/query to implement the same for the next levels.

    Could anyone please help me regarding this problem.

    Thanks in advance.

    Vill
    Vill
    Cognizant

  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: Changing the Status of all the Child Requirements

    There are two ways to update the data : through SQL, using the Command property of TDConnection, or through the OTA, using the Req object.
    The problem with SQL is that you by-pass all the controls that QC may have in place for the requirement and the user and, in particular, you do not take into account locked requirements, i.e. those requirements that are being updated by other users.
    With the OTA, your code would be recursive, something like :
    <font class="small">Code:</font><hr /><pre>
    Sub UpdateStatus (reqID, newStatus)
    Dim req, reqChildren
    Set req = TDConnection.ReqFactory.Item (reqID)
    req.Status = newStatus
    On Error Resume Next : Err.Clear
    req.Post
    If Err &lt;&gt; 0 Then
    MsgBox "Cannot update status of requirement #" &amp; CStr (reqID) &amp; vbCrLf &amp; Err.Description
    Err.Clear
    End If
    On Error GoTo 0
    Set req = Nothing
    Set reqChildren = TDConnection.ReqFactory.GetChildrenList (reqID)
    For Each req in ReqChildren
    UpdateStatus req.ID, newStatus
    Next
    Set reqChildren = Nothing
    End Sub
    </pre><hr />

  3. #3
    Member
    Join Date
    Oct 2007
    Location
    TN, India
    Posts
    66
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Changing the Status of all the Child Requirements

    Thanks Christian.

    For your Information, I have placed the above code in the Req_FieldChange event in the Workflow editor to execute the code every time the requirement status field is changed.

    while executing the above script i experienced there seems to be some errors in between but i cant find the exact error because it is not displayed due to the recovery statement, If removed the recovery statement it runs unended loop.

    I hope the above script will work for all the first child in the parent, but for the last parent in the hierarchy the status will be changed to all the child.

    Sorry Christian for drafting such a long mail.

    Please help.

    Thanks in advance

    Vill


    Vill
    Cognizant

  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: Changing the Status of all the Child Requirements

    In Req_FieldChange, you should have :
    UpdateStatus Req_Fields("RQ_REQ_ID").Value, Req_Fields("RQ_REQ_STATUS").Value
    The UpdateStatus sub shown in my previous mail should be outside of the Req_FieldChange sub.

  5. #5
    Member
    Join Date
    Oct 2007
    Location
    TN, India
    Posts
    66
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Changing the Status of all the Child Requirements

    Yes Christian i did the same but the value is not changed for the child requirements.

    Actually i have created user defined field namely "Requirement Status". The field name for that field is "RQ_USER_40". I need to change the value of this field to be changed for all the child req.

    In your code instead of the below line what should i replace for changing the RQ_USER_40 value:

    "req.Status = newStatus"

    Pls help
    Vill
    Cognizant

  6. #6
    Member
    Join Date
    Oct 2007
    Location
    TN, India
    Posts
    66
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Changing the Status of all the Child Requirements

    I got the code for the above issue and it is working fine.

    req.Field("RQ_USER_40") = newStatus

    thanks
    Vill
    Vill
    Cognizant

 

 

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.11%
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 10:20 AM.

Copyright BetaSoft Inc.