我尝试使用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
});
如果我删除"投资组合"属性,则它的工作方式就像魅力。
这是我的全球脚本:
<!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>
我尝试声明一个新的投资组合对象,该对象将引用我想要的功能。然后我在故事层面引用它,但行为完全相同:
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"
});
}
});
作为链接故事及其父型功能的一个示例,请?
我会尝试更改此行:
PortfolioItem: '/portfolioitem/featureset/12345'
:
PortfolioItem: '/portfolioitem/feature/12345'