我对 Rally 还很陌生,并且一直在对其进行测试。我一直在查看他们的 python 框架来使用他们的 API。不幸的是,在文档中我找不到添加任务的方法。
以前有没有人使用过这个,或者任何人都可以建议一种通过 API 导入任务的简单方法?目前,我有一个完整的电子表格,其中包含遵循 csv 模板导入数据的任务。
一个 Rally 任务项必须与一个 WorkProduct(通常是一个工件,如 HierarchicalRequirement(又名 UserStory)、Defect 或 TestCase)相关联。使用 pyral 工具包,一旦你有你的 Rally 实例,获取要与任务关联的 Workspace、Project 和 WorkProduct 的对象引用,然后用这些项目以及其他必需的 Task 属性填充 Python dict 并抛出它在拉力赛。
任务创建配方:
[insert your boilerplate code for dealing with command line args, Rally options, etc]
rally = Rally(server, username, password, workspace=workspace, project=project)
artifact_ident = args.pop() # get the FormattedID of an artifact as the Task relation target
wksp = rally.getWorkspace()
proj = rally.getProject()
artifact = rally.get("UserStory", fetch="FormattedID",
query='FormattedID = "%s"' % artifact_ident,
instance=True)
# for a Task, the Workspace, Project, WorkProduct, Name, State and TaskIndex attributes
# are required. The Workspace, Project and WorkProduct attributes must be supplied as
# valid Rally object references.
info = { "Workspace" : wksp.ref,
"Project" : proj.ref,
"WorkProduct" : artifact.ref,
"Name" : "Scrape vanilla bean",
"State" : "Defined",
"TaskIndex" : 1,
"Description" : "With a dull knife, strip material from the vanilla bean"
}
task = rally.put('Task', info)
print "Created Task: %s associated with UserStory %s" % (task.FormattedID, artifact.FormattedID)