SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Mar 2003
    Location
    Tamworth, UK
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to use IsInGroup?

    Hi,

    I am trying to create some workflow scripts for the defect module of QC10 but I am having problems with the IsInGroup function and wonder if anyone can help.

    I have successfully used the user.isingroup("groupname") function to auto populate fields when adding a new defect as per the following example:

    <font class="small">Code:</font><hr /><pre>Sub Bug_New
    WizardFieldCust_Add ' Added by wizard
    if User.IsInGroup("Business Analysis") then
    Bug_Fields.Field("BG_USER_06").Value = "Business Analysis"
    end if
    End Sub</pre><hr />

    I now want to populate a field based based on the group assigned to a username populated in a field rather than the person who is logged in?

    <font class="small">Code:</font><hr /><pre>Sub Bug_FieldChange(FieldName)
    On Error Resume Next

    If FieldName = "BG_RESPONSIBLE" Then
    If IsInGroup(Bug_Fields("BG_RESPONSIBLE").Value, "Test Analysts") then
    Bug_Fields("BG_USER_07").value = "System Testing"
    End if
    End if

    On Error GoTo 0
    End Sub</pre><hr />

    What I am hoping is that every time the BG_RESPONSIBLE field is amended the system will check if the user entered in that field is a member of the "Test Analysts" group and if they are it will then populated "BG_USER_07" with "System Testing".

    Any help will be greatly appreciated.

  2. #2
    Junior Member
    Join Date
    Mar 2003
    Location
    Tamworth, UK
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to use IsInGroup?

    I managed to find the answer on the HP forums but had to tweak it a little due to a variable naming issue. As such I ended up with the following code:

    <font class="small">Code:</font><hr /><pre>testername = Bug_Fields("BG_RESPONSIBLE").value

    If TDConnection.Customization.Users.User(testername). InGroup("Test Analysts") = True Then
    Bug_Fields("BG_USER_07").value = "System Testing"
    End If</pre><hr />

    The above works a treat.

 

 

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 12.50%
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 11:43 AM.

Copyright BetaSoft Inc.