我正在尝试获取 Rally 中特定用户故事的父史诗/功能。但是我只得到父对象,我不知道如何解析它。我尝试过dict和 dir(object) 来获取字段值,但它不起作用。我也尝试过以下方法,但我不断得到类似的东西,而不是父对象中的字段/值
pyral.entity.PortfolioItem_Capability 对象位于 0x7ff848273850
代码:
def get_hierarchy(server,username,password,workspace,project,release):
rally = Rally(server, username, password, workspace=workspace, project=project)
criterion = 'Release.Name = "'+release+'" AND Parent != None'
response = rally.get('HierarchicalRequirement',fetch="ObjectID,FormattedID,Name,AcceptedDate,Project,Release,ScheduleState,Parent,Description",query=criterion,limit=5000)
return response
for item in get_hierarchy("rally1.rallydev.com","some.email@address.com","Somepassword","Some Workspace Name","PROJECT NAME","Release Version"):
print item.FormattedID, item.Name, item.ScheduleState, item.Description, item.Parent.Name