22-05-2020 10:21 PM
Hi,
I want to set Project MetaClass "Project Leader" property via VB script, how can i do it?
NOTE: hopex v2r1 version
Thanks,
Solved! Go to Solution.
23-05-2020 09:30 AM
23-05-2020 08:08 AM
Hi, the following code snippet is used to set the current user as project participant on the EA Project. You need to change the business role to the Project Leader and the person.
Dim mgobjRole : Set mgobjRole = oRoot.GetCollection("~230000000A40[Business Role]").Item("~AV6BAZhPIjhG[Project Participant]")
If (mgobjRole.Exists) Then
If (mgobjRole.IsAvailable) Then
Dim mgobjCurrentUser : Set mgobjCurrentUser = oRoot.GetCollection("~T20000000s10[Person <System>]").Item(oRoot.CurrentEnvironment.GetCurrentUserID)
Dim mgobjPersonAssign : Set mgobjPersonAssign = Manager.Template.GetCollection("~gCr81RIpErMH[Person Assignment]").Create
mgobjPersonAssign.Getcollection("~L2000000Ca80[Assigned Person]").Add mgobjCurrentUser
mgobjPersonAssign.Getcollection("~M2000000Ce80[Business Role]").Add mgobjRole
Set mgobjPersonAssign = Nothing
End If
End If
Set mgobjRole = Nothing