New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
916 views

Customize Assigned To user.

I'm tasked to customize the Assigned To user list to display only user that are relevent to current logged in user group.

 

Here is the group and user structure :

 

Group Name : "TestManager"

Users :

1. testmanager1

2. testmanager2

3. sha.testmanager3

 

Group Name : "Tester"

Users :

1. tester1

2. user1.tester

 

Scenario and Rules:

username tester1 is in a group called "Tester". User in this group can only assign new defect to user in group "TestManager". So the question is how to filter the user list in Assigned To or BG_RESPONSIBLE field to only show user that are relevent to current logged in user group.

0 Likes
5 Replies
Highlighted
Fleet Admiral
Fleet Admiral

You cannot segregate/Split/Filter the user list in the "Assigned to"  field, & you can make visible thefield to only particuar user group through workflow script editor, refer the Admin guide, it explains a lot in detail to an extent of use...!!

(If this helped, accept as solution )
(Posts and opinions made here are my own and do not reflect the opinions of my employer)
Highlighted
Fleet Admiral
Fleet Admiral

You can't filter the user list the way you want. Two ways to accomplish your goal:

 

  1. Add code to Bug_FieldCanChange that evaluates the choice made by the user. If an invalid option is selected you return False, which resets the field to the original value. You can display a message to the user that explains which options are allowed.
  2. Create a new field of type Lookup list. Create two lookup lists with the relevant user names on each. You can let this field update the Assigned To field from the workflow Bug_FieldChange procedure. For the new field you can switch the user list associated with the field at login, based on the user group membership. The tricky thing here might be to keep the lists updated when the members of your groups change. You might automate this to some extent, but if the user groups are fairly stable you could do it manually.
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
Highlighted
Absent Member.
Absent Member.

By studying the Sample ALM Defect Customization, I get an idea of synchronizing BG_RESPONSIBLE with BG_USER_01 (Lookup List).

 

I then create a function to list username based on group (obtained the US_GROUP in ALM Site Admin, in Database tab and then crossmatch with username accordance to groups set in ALM).

 

Function RetrieveUserInGroup()
On Error Resume Next
dim com 'As Command
dim rec 'As RecordSet
set com = TDConnection.Command

If User.IsInGroup("Tester") Then
SQL = "select US_USERNAME from USERS where US_GROUP='00001100'"
Else If User.IsInGroup("TestManager") Then
SQL = "select US_USERNAME from USERS where US_GROUP='00001100' And US_GROUP='00001010' And US_GROUP='00001001'"
End If
End If

com.CommandText = SQL
set rec = com.Execute
For Each row In rec.Rows
RetrieveUserInGroup = row
Next

set rec = nothing
set com = nothing
On Error GoTo 0
End Function

Then I put this code into Bug_FieldChange(FieldName)

 

'Set value to BG_USER_01 with RetrieveUserInGroup function
Bug_Fields("BG_USER_01").Value = RetrieveUserInGroup()

'Synch the Assigned To Lookup List with the AssignedTo User List
Bug_Fields("BG_RESPONSIBLE").Value = Bug_Fields("BG_USER_01").Value

Here's the US_GROUP value correspond to group name in ALM :

 

Table : USERS

US_USERNAME                    US_GROUP                                      Group Name

admin                                     10001000                                        TDAdmin
user_1                                    10001000                                        TDAdmin
testmanager1                     00001010                                        TestManager
tester1                                   00001100                                        Tester

 

Need advice, am I getting somewhere to what I want?

0 Likes
Highlighted
Fleet Admiral
Fleet Admiral

No, that won't work. You function will only return the last username on the list - it will not produce a list. Moreover, selecting usernames based on the bitmask will only work for users who are members of exactly the same groups (in your example two specific groups).

 

So you had better build the lookup lists with user names manually. Then in Bug_MoveTo (and Bug_New) you can set the list associated with the field:

 

If User.IsInGroup("ABC") Then
    Bug_Fields("BG_USER_01").List = List("UserList1") 
ElseIf User.IsInGroup("DEF") Then
   Bug_Fields("BG_USER_01").List = List("UserList2") 
End If
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Highlighted

@Jan Czajkowski : Just want to mention that your this note has helped me to resolve a query that I had in this regard.

Thank you.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.