Workflow to set a defect field value based on Assigned To user’s group
Question ID: 107338
1
0

I required some aid in setting up some workflow to set a field's value under defects based on the user group that the Assigned To user belongs to for a defect. Meaning if defect 42 is Assigned To user jsmith, I then want to poll what user group jsmith is in and auto assign a value to UDF BG_USER_05. Tried a few things but they are not quite working out.

Marked as spam
Posted by (Questions: 104, Answers: 0)
Asked on January 16, 2017 4:05 pm
48 views
Answers (1)
1
Private answer

Hello,

Here is a sample of code that would poll the user group of the user assigned to BG_RESPONSIBLE (Assigned To) and write a value to the field BG_USER_05. You will want to add this code to Bug_FieldChange under the Defects workflow.

Below code would fire at the point of setting a user value to Assigned To then poll the user group and if a match (in this case I used QA Tester group) would then write value of My value to the UDF.

If FieldName = ''BG_RESPONSIBLE'' then
testername = Bug_Fields.Filed(''BG_RESPONSIBLE'').value
If TDConnection.Customization.Users.User(testername).InGroup(''QA Tester'') = True Then
Bug_Fields(''BG_USER_05'').value = ''My value''
End If
End If

Please alter the UDF field DB name as needed to match your UDF, the user group name, and the ''value'' to be written. Can add other values for other groups as needed. The above is just a generic sample for one case.

Marked as spam
Posted by (Questions: 1, Answers: 116)
Answered on January 16, 2017 4:11 pm
0
Thank you! Will try this out but I can already see what I was doing wrong. Appreciate.
( at January 16, 2017 4:16 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top