Python 2.7 通过rally API更新父级

Python 2.7 通过rally API更新父级,python-2.7,python-3.x,rally,Python 2.7,Python 3.x,Rally,我有1000多个项目在我们的一个工作空间下处于关闭状态 我从-https://rally1.rallydev.com/slm/webservice/1.29/subscription?fetch=Workspaces,名称,项目,州 我们希望更新标记为“已关闭”的项目的“父项” 我在这里找不到任何更新项目父级的参考-Rest APIpostmethod-我将按以下方式进行: #get object for 'New Parent': target_project=rally.getProjec

我有1000多个项目在我们的一个工作空间下处于关闭状态

我从-
https://rally1.rallydev.com/slm/webservice/1.29/subscription?fetch=Workspaces,名称,项目,州

我们希望更新标记为“已关闭”的项目的“父项”


我在这里找不到任何更新项目父级的参考-Rest API
post
method-

我将按以下方式进行:

#get object for 'New Parent':
target_project=rally.getProject('NewParentForClosedProjects')

projects=rally.getProjects(workspace=workspace) 对于项目中的项目:

    #get children of project
    children = proj.Children

    for child in children:

        #if project closed:
        if child.State == 'Closed':
            #Then update Parent to new one:
            project_fields = {
                "ObjectID": child.oid,
                "Parent": target_project.ref
            }
            try:
                result = rally.update('Project', project_fields)
                print "Project %s has been successfully updated with new %s parent" % (str(child.Name), str(child.Parent))
            except RallyRESTException, ex:
                print "Update failure for Project %s" % (str(child.Name))
                print ex

什么语言?有用于node、java、.net等的工具包。这应该是一个相当简单的脚本-执行查询以查找所有已关闭的项目,循环每个项目并将其父项目设置为新项目。如果你能发布一些代码来显示你的进度,我们可能会提供更多帮助…@KyleMorse-我正在用Python进行尝试,但我们可以灵活地让它在ruby或nodejs等任何语言中工作。到现在为止,我已经有了我想转移到不同父级的项目列表。我正在寻找一个API方法,它可以为一个项目做到这一点。我认为你可以添加到一个项目的儿童收集25项一次。这会大大减少你的通话量。我不确定python或ruby工具包是否支持这一点。node肯定是这样。
#get object for 'New Parent':
    #get children of project
    children = proj.Children

    for child in children:

        #if project closed:
        if child.State == 'Closed':
            #Then update Parent to new one:
            project_fields = {
                "ObjectID": child.oid,
                "Parent": target_project.ref
            }
            try:
                result = rally.update('Project', project_fields)
                print "Project %s has been successfully updated with new %s parent" % (str(child.Name), str(child.Parent))
            except RallyRESTException, ex:
                print "Update failure for Project %s" % (str(child.Name))
                print ex