标题: 请各位高手指点 [打印本页] 作者: 淡茶飘香 时间: 2008-12-20 04:38 标题: 请各位高手指点 在td中,我想在添加缺陷时,将缺陷分配给开发人员,但是Assigned to中用户是所有组的全部用户,怎么设置或使用流程控制语句能实现Assigned to的人员全部是开发人员呢作者: wssgily 时间: 2008-12-20 08:48
QC中,view by group应该可以实现你的功能,然后把开发用户分在一个组中。
TD,忘记是不是也有这个功能了。
试一下,有什么问题再讨论.作者: 飘渺的风 时间: 2008-12-20 10:32
Function Defects_Bug_CanPost
On Error Resume Next
if Bug_Fields.Field("BG_STATUS").Value = "新建" and UserGroup(Bug_Fields("BG_RESPONSIBLE").Value) <> "研发工程师" then
msgbox "请把新建的BUG单交给研发部门成员"
Defects_Bug_CanPost = False
End if
On Error GoTo 0
End Function
Function UserGroup (tuser)
Dim Cust
Dim CustUserGroups
Dim CustGroup
Set td = TDConnection
Set Cust = td.Customization
Cust.Load
Set CustUserGroups = Cust.UsersGroups
Set CustGroupList = CustUserGroups.Groups
usergroup = ""
For i = 1 To CustGroupList.Count
Set CustGroup = CustUserGroups.Group(CustGroupList(i).Name)
Set GroupUserList = CustGroup.UsersList
For j = 1 To GroupUserList.Count
If GroupUserList(j).Name = tuser Then
usergroup = CustGroupList(i).Name
Exit For
End If
Next
If usergroup <> "" Then
Exit For
End if
Next
Set CustUserGroups = nothing
Set CustGroupList = nothing
Set CustGroup = nothing
Set GroupUserList = nothing
Set td = nothing
End Function