发新话题
打印

[已解决] CHANGE批量修改数据( 此文章被查看:325次,被回复:3篇!! )

CHANGE批量修改数据

由于流程里新增了一个标识为“SL”结束的状态,有几百个处于前一阶段“SK”的CR需要迁移到该状态,同时要将每个CR的“SL”状态结束时间“B”的值设置为“SK”状态的字段“A”的值,本人对CCM query 的命令不是很熟悉,请高手指点,最好有个例子。


问题已经解决 [打开主题]
本主题的最佳答案为 [ 2 楼].



© 本文为 123qweSCMLife 共同所有,未经同意,请勿转载 ©如该文侵犯了您的版权,请联系管理员

TOP

是需要强行修改SL状态的结束时间么?这样需要用Perl写个脚本来做。

可以用ModifyCR这个API,详细的参考 附件

ModifyCR
Apply the modified Change Request data. Only data objects that have been flagged as modified are submitted to the ChangeSynergy server. The attributes problem_number, modify_time, and cvid, should not be altered. The api classes will automatically process these attributes when needed. The return result is an instance of the apiData class.

Note: The apiObjectData's member method setValue("") will automatically set the modified flag when invoked.

Parameters:
        apiUser         aUser: The current api user's login data.
        apiObjectVector data : The data to be processed by the api function.
Returns: apiData
        results on if the modify was successful

Example:

        my $csapi = new ChangeSynergy::csapi();
        eval
        {
                $csapi->setUpConnection("http", "angler", 8600);
                my $aUser = $csapi->Login("u00001", "u00001", "User", "\\\\angler\\ccmdb\\cm_database");
                my $tmp = $csapi->AttributeModifyCRData($aUser, "100", "crstatus");
                or
                my $tmp = $csapi->AttributeModifyCRData($aUser, "100");
                or
                my $tmp = $csapi->ModifyCRData($aUser, "100", "CRDetail");
                or
                my $tmp = $csapi->GetCRData($aUser, "100", "problem_synopsis|problem_description|keyword");
               
                $tmp->getDataObjectByName("problem_synopsis")->setValue("I modified the synopsis through the csapi...");
                $tmp->getDataObjectByName("problem_description")->setValue("I modified the description through the csapi...");
                $tmp->getDataObjectByName("keyword")->setValue("csapi");
                my $tmpstr = $csapi->ModifyCR($aUser, $tmp);
        };
        if ($@)
        {
                print $@;
        }


最佳答案
该回答被楼主/管理员列为正解!

附件

perlapi.chm (103.18 KB, 2008-3-14 16:02)

关于附件奖励, 下载次数 2, 使用阶层: 通用 , 推荐星级: , 出售价格: 2 金钱 , 你的购买价格: 2 金钱




© 本文为 hasjingSCMLife 共同所有,未经同意,请勿转载 ©如该文侵犯了您的版权,请联系管理员
强身健体,努力减负

TOP

怎么样用ccm qeury来处理呢

我记得培训的时候,有提到用ccm query 来修改数据,因为我要做的修改量叫大 我想编个批处理脚本来实习,不知道有没有高手知道怎么做,另外还有个疑问 :
ccm query -l @number 显示查询结果里的第number 条数据,这条命令系统报错



© 本文为 123qweSCMLife 共同所有,未经同意,请勿转载 ©如该文侵犯了您的版权,请联系管理员

TOP

回复 板凳 的帖子

你的语法好像是错的!
query命令只能查看属性的值,不能进行修改的。

© 本文为 hasjing 所有,未经同意,请勿转载
©如该文侵犯了您的版权,请联系管理员
强身健体,努力减负

TOP

发新话题