Display a users full name instead of userid in a defect automail
Question ID: 106943
0
0

We have recently upgraded ALM from 11.0 to 12.20. We are facing an issue for automatic emails generated when a defect is created. For example, we would like to have the users full name displayed instead of the UserID, which currently displays in the defect automail. We are currently using the SendDefectMail method, but only the userid's are displayed in the email. Will it be possible to have the full name displayed in the defect email instead of the user Id’s tagged to that name?

Marked as spam
Posted by (Questions: 239, Answers: 31)
Asked on July 6, 2016 3:50 pm
31 views
Answers (1)
0
Private answer

I have found that the following workflow script, used along with the SendDefectMail method may be what you are looking for. Enter the following workflow into the Defects module script within the Script Editor. The script assumes that the 'Assigned User' (BG_USER_01) and 'Detected User' (BG_USER_03) fields have been created. These fields will display the full name in the defect automail associated with the userid that populates the 'Detected By' and 'Assigned To' fields. In the defect automail, you will still see the 'Assigned To' and 'Detected By' fields, as these are links used to email the user displayed in that field.

Note: This is some example script that may need to be modified to fit your specific needs. I suggest that you give this a try in your test environment before implementing in your production environment.

Sub Bug_New
On Error Resume Next
'Script for the Assigned User field
Bug_Fields.Field(''BG_USER_01'').IsVisible = true
Bug_Fields.Field(''BG_USER_01'').IsReadOnly = true

'Script for the Detected User field
Bug_Fields.Field(''BG_USER_03'').IsVisible = true
Bug_Fields.Field(''BG_USER_03'').IsReadOnly = true
Bug_Fields.Field(''BG_USER_03'').Value = User.FullName

On Error GoTo 0
End Sub

Function getuserFullName(strUserName)
getuserFullName = TDConnection.Customization.Users.User(strUserName).FullName
End Function

Sub Bug_MoveTo
On Error Resume Next
Bug_Fields.Field(''BG_USER_01'').IsVisible = true
Bug_Fields.Field(''BG_USER_01'').IsReadOnly = false
Bug_Fields.Field(''BG_USER_03'').IsVisible = true
Bug_Fields.Field(''BG_USER_03'').IsReadOnly = false
Bug_Fields.Field(''BG_USER_01'').Value = UserFullName(Fields(''BG_RESPONSIBLE'').Value)
Bug_Fields.Field(''BG_USER_03'').Value = UserFullName(Fields(''BG_DETECTED_BY'').Value)

If Bug_Fields(''BG_USER_01'').Value <> UserFullName(Fields(''BG_RESPONSIBLE'').Value) then
Bug_Fields(''BG_USER_01'').Value = UserFullName(Fields(''BG_RESPONSIBLE'').Value)
ElseIf Bug_Fields(''BG_USER_03'').Value <> UserFullName(Fields(''BG_DETECTED_BY'').Value) then
Bug_Fields(''BG_USER_03'').Value = UserFullName(Fields(''BG_DETECTED_BY'').Value)
End if

Bug_Fields.Field(''BG_USER_01'').IsReadOnly = true
Bug_Fields.Field(''BG_USER_03'').IsReadOnly = true

On Error GoTo 0
End Sub

Sub Bug_FieldChange(FieldName)
On Error Resume Next
If FieldName = Bug_Fields(''BG_RESPONSIBLE'').FieldName Then
Bug_Fields(''BG_USER_01'').Value = getuserFullName(Bug_Fields(''BG_RESPONSIBLE'').Value)
ElseIf FieldName = Bug_Fields(''BG_DETECTED_BY'').FieldName Then
Bug_Fields(''BG_USER_03'').Value = getuserFullName(Bug_Fields(''BG_DETECTED_BY'').Value)
End If

On Error GoTo 0
End Sub

Marked as spam
Posted by (Questions: 2, Answers: 300)
Answered on July 6, 2016 3:51 pm
EyeOnTesting

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

X
Scroll to Top