我正在尝试使用以下代码将标签名称作为列获取:
查询对象:
var queryObject = {
key: 'storiesBackLog',
type: 'hierarchicalrequirement',
fetch: 'FormattedID,Name,PlanEstimate,ScheduleState,Tags',
query: '(ScheduleState = "Backlog")',
order: 'FormattedID'
};
表配置:
var config = { columns:
[
{key:'FormattedID', header:'ID', width:60},
{key:'PlanEstimate', header:'Points', width:60},
{key:'Name', header:'Name', width:400},
{key:'Tags.Name', header:'Department', width:400},
]
};
使用 Tags.Name,结果为 ...,使用 Tags,结果为 [object Object]。有谁知道关键是什么?
最终解决方案:
rally.forEach(results.storiesBackLog, function(story) {
var tags = [];
rally.forEach(story.Tags, function(tag) {
tags.push(tag.Name);
});
story.TagNames = tags.join(';');
});
var tableBackLogConfig = { columns:
[
{key:'TagNames', header:'Department', width:400},
]
};