Is it possible to get the stories with title containing text "Testing" in it by using filters ?
eg 1. Mobile Testing
2. Testing Smartphone
You may use contains operator:
Ext.create('Rally.data.WsapiDataStore', {
model: 'UserStory',
fetch: ['FormattedID','Name'],
autoLoad: true,
filters:[
{
property: 'Name',
operator: 'contains',
value: "Mobile"
}
],
listeners: {
load: this._onDataLoaded,
scope: this
}
});
Related
I have this code:
var projectStore = Ext.create('Rally.data.WsapiDataStore',{
model: 'project',
fetch: ['Name','ObjectID'],
autoLoad: true,
context:{
project: '/project/33086603461',
projectScopeDown: true,
projectScopeUp:false
},
listeners:{
load: function(store,records,success){
console.log('store ',records);
},
scope: this
}
});
When I print the store , it is showing up all the projects instead of just the project with the given object ID and its children. How do I access only the children of the given project?
The project endpoint in WSAPI is a little different in that it does not obey the project/projectScopeUp/projectScopeDown parameters.
You should just add a filter to your store referencing the parent project instead:
var projectStore = Ext.create('Rally.data.WsapiDataStore',{
model: 'project',
fetch: ['Name','ObjectID'],
autoLoad: true,
filters: [{
property: 'Parent',
operator: '=',
value: '/project/33086603461'
}],
listeners:{
load: function(store,records,success){
console.log('store ',records);
},
scope: this
}
});
Question 1: Is it possible to add custom data (Ex: testcase count : 5) to each card in a story board? If so, how? I couldn't find an example or specific information in documentation.
Question 2: Is it possible to get testcase count (including child story testcases)for a highlevel story in one query?
Please let me know. Here's my code
Ext.define('Rally.Story.View', {
extend: 'Rally.app.App',
launch: function() {
this.add({
xtype: 'rallyfieldvaluecombobox',
fieldLabel: 'Filter by Target Release:',
model: 'UserStory',
field: 'c_TargetRelease',
value: '15.0',
listeners: {
select: this._onSelect,
ready: this._onLoad,
scope: this
}
});
},
_onLoad: function() {
this.add({
xtype: 'rallycardboard',
types: ['User Story'],
attribute: 'ScheduleState',
readOnly: true,
fetch: ['Name', 'TestCases', 'c_StoryType', 'c_TargetRelease', 'PlanEstimate', 'Priority', 'TaskEstimateTotal', 'TaskRemainingTotal'],
context: this.getContext(),
cardConfig: {
editable: false,
showIconsAndHighlightBorder: false,
fields: ['Name', 'c_StoryType', 'c_TargetRelease', 'PlanEstimate', 'c_PriorityBin', 'Parent', 'TestCases', 'TaskEstimateTotal', 'TaskRemainingTotal']
},
storeConfig: {
filters: [
{
property: 'c_StoryType',
value: 'SAGA Feature'
},
{
property: 'c_TargetRelease',
operator: '=',
value: this.down('rallyfieldvaluecombobox').getValue()
}
]
}
});
},
_onSelect: function() {
var board = this.down('rallycardboard');
board.refresh({
storeConfig: {
filters: [
{
property: 'c_StoryType',
value: 'SAGA Feature'
},
{
property: 'c_TargetRelease',
operator: '=',
value: this.down('rallyfieldvaluecombobox').getValue()
}
]
}
});
},
});
Here's a sample card I made that contains the test case count:
You can add a field by simply including an object with some rendering information in it instead of just a simple string in the fields array in the cardConfig:
cardConfig: {
fields: [
'Name', //simple string field to show
{
name: 'TCCount', //field name
hasValue: function() {return true;}, //always show this field
renderTpl: Ext.create('Rally.ui.renderer.template.LabeledFieldTemplate', {
fieldLabel: 'Test Case Count', //the field label
valueTemplate: Ext.create('Ext.XTemplate',
['{[this.getTestCaseCount(values)]}',
{getTestCaseCount: function(data) { return data.Summary.TestCases.Count;}}])
})
},
//additional string fields
'PlanEstimate', 'Parent', 'TestCases', 'TaskEstimateTotal', 'TaskRemainingTotal']
}
This ended up being less straightforward than I thought it might be, but at least it is doable. The key part is using the LabeledFieldTemplate, specifying a field label and a value template to actually render the content.
You'll also notice the little beaker status icon in the footer which is automatically rendered because TestCases was included in the fields list.
As for your second question there is no roll up field on story for the total number of test cases included on child stories.
I'm currently working with comboboxes and filters to implement an option to select all instances of a desired field. With that said, I know to use the noEntryText attribute to set what originally defaults to "--No Entry--" as "All". However, the changes do not seem to apply when I use this on custom fields provided by my Web Services API (those fields with the "c_" before them).
Strangely enough though, this convention works for other fields that I use that do not have the "c_" before them. So is this a known defect just for custom fields or is there a workaround to this issue?
I filed a defect that replacing noEntryText to a custom value works for rallyfieldvaluecombobox for standard fields, but not custom fields.
If rallyfieldvaluecombobox uses a standard field, e.g. Environment, then no entry can be replaced successfully:
Here is the js file:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
this.add({
xtype: 'rallyfieldvaluecombobox',
itemId: 'aBox',
fieldLabel: 'Filter by filed:',
model: 'defect',
//field: 'c_CustomBox',
field: 'Environment',
noEntryText: 'All',
useNullForNoEntryValue: true,
allowNoEntry: true,
listeners: {
select: this._onSelect,
ready: this._onLoad,
scope: this
}
});
},
_onLoad: function() {
this.add({
xtype: 'rallygrid',
columnCfgs: [
'FormattedID',
'Name',
//'c_CustomBox'
'Environment'
],
context: this.getContext(),
storeConfig: {
model: 'defect',
filters: [this._getStateFilter()]
},
width: 500
});
},
_getStateFilter: function() {
if (!this.down('#aBox').getValue()) {
return 1;
}
else{
return {
//property: 'c_CustomBox',
property: 'Environment',
operator: '=',
value: this.down('#aBox').getValue()
};
}
},
_onSelect: function() {
var grid = this.down('rallygrid'),
store = grid.getStore();
store.clearFilter(true);
store.filter(this._getStateFilter());
}
});
If the same rallyfieldvaluecombobox uses a custom field, then no entry string cannot be replaced:
In both cases the functionality of replacing the filtering behavior works fine.
I am having problem in using filters with "And" and "or" clause. Basically i want to get any userstories having text "Mobile" or "Testing"
I am trying like this :
_createFilters:function(){
var filter = Ext.create('Rally.data.QueryFilter',
{
property: 'Name',
operator: 'contains',
value: 'Mobile'
}
);
filter = filter.or(Ext.create('Rally.data.QueryFilter',
{
property: 'Name',
operator: 'contains',
value: 'Testing'
}));
return filter.toString();
},
_makeDefectsStore:function(ref){
Ext.create('Rally.data.WsapiDataStore',{ // will fetch userstories that have defects
model: 'User Story',
limit: "Infinity",
context: {
project :'/project/xxxx',
projectScopeUp: false,
projectScopeDown: true
},
autoLoad: true,
fetch:['FormattedID','Name','Defects','Feature'],
filters: [this._createFilters()],
scope:this,
listeners: {
load: this._onAllDefectsLoaded,
scope: this
}
});
}
Here filter is returning null, otherwise all the userstories are returned without filtering . Please provide suggestion/fix
Nothing immediately pops out as being incorrect with your filter construction, you might try this simpler version though and see what you get:
Ext.create('Rally.data.WsapiDataStore', {
model : 'UserStory',
filters : Rally.data.QueryFilter.or([{
property : 'Name',
operator : 'contains',
value : 'Testing'
},{
property : 'Name',
operator : 'contains',
value : 'Mobile'
}])
});
Is there a way to query multiple 'models' using a single query? Similar to lookback query using _Type: {'$in': ['HierarchicalRequirement','Defect']}
Ext.create('Rally.data.WsapiDataStore', {
model: ['UserStory','Defect'], //this does NOT work
context: context,
autoLoad: true,
filters: newFilter,
fetch: 'Name,FormattedID,AcceptedDate,ScheduleState,PlanEstimate,KanbanState',
sorters: [
{
property: 'AcceptedDate',
direction: 'ASC'
}
],
listeners: {
load: this._onDataLoaded,
scope: this
}
});
This is currently not supported by the RUI SDK, but hopefully will be sometime down the road.