Rally SDK 2 - 如何将故事附加到功能

Rally SDK 2 - How to attach a story to a feature

我尝试使用 Rally SDK 2.1 (Javascript) 编写自定义 HTML 块以创建新故事。我可以想出如何使用自定义标题和描述来创建故事。

如果我尝试设置该功能,则创建会挂起并且没有任何反应... 以下是我在脚本中设置功能的方式:

      var story = Ext.create(model, {
       Name: 'Can be deleted, created via Rally app SDK 2.1',
       Description: 'Dummy generated story - tests',
       PortfolioItem: '/portfolioitem/featureset/12345' // FEATURE
      });
如果我删除 "PortfolioItem" 属性,那么它就像一个魅力。

这是我的全局脚本:

<!DOCTYPE html>
<html>
<head>
    <title>test - Story creation</title>
 
    <script type="text/javascript" src="/apps/2.1/sdk.js"></script>

    <script type="text/javascript">  
  
  // SDK documentation: https://docs.ca.com/en-us/ca-agile-central/saas/apps/2.1/doc/#!/api
    
        Rally.onReady(function() {
     
   // Create a new story
   function addStory() {  
   
    console.log('Creating a new story...');
    // Retrieve the Rally user stories model
    Rally.data.ModelFactory.getModel({
     type: 'UserStory',
     context: {
      workspace: '/workspace/12345', // dummy reference
      project: '/project/12345' // dummy reference
     },
     success: function(model) {
      // Create a new story thanks to the retrieved model
      var story = Ext.create(model, {
       Name: 'Can be deleted, created via Rally app SDK 2.1',
       Description: 'Dummy generated story - tests',
       PortfolioItem: '/portfolioitem/featureset/12345' // dummy reference
      });
      // Save the new story
      story.save({
       callback: function(result, operation) {
        if(operation.wasSuccessful()) {
         console.log('New story created!', result.get('FormattedID'));
        }
       }
      });
     }
    });
   }
   
   // The Rally application
   Ext.define('Rally.grg.storyCreation', {
    extend: 'Rally.app.App',
    
    // Method fired on application launch
    // Retrieve release features asynchronously
    launch: function() {
     console.log('Launch...');
     addStory();  
    }     
   });   
      
            Rally.launchApp('Rally.grg.storyCreation', {
              name: 'test - Story creation'
            }); 

        });
    </script>

    <style type="text/css">
        
    </style>
</head>
<body></body>
</html>

我试图声明一个新的投资组合项目 object 来引用我想要的功能。然后我在故事级别引用它,但它的行为完全相同:

    var f; 
   
    console.log('Defining the feature...');
    // Retrieve the Rally features model
    Rally.data.ModelFactory.getModel({
     type: 'portfolioitem',
     success: function(portfolioitemkModel) {
      // Define an existing feature thanks to the retrieved model
      f = Ext.create(portfolioitemkModel, {
       _ref: "/portfolioitem/featureset/12345",
       _refObjectName: "...",
       _refObjectUUID: "...",
       _type: "PortfolioItem/FeatureSet"       
      });
     }
    }); 

作为某人链接故事及其 parent 功能的示例,请问 JavaScript SDK2,好吗?

我会尝试更改此行:

PortfolioItem: '/portfolioitem/featureset/12345'

对此:

PortfolioItem: '/portfolioitem/feature/12345'