Accessing "Planned Velocity" field available in iteration using Rally API 2.0 - iteration

I am trying to access the "Planned Velocity" field which is available for Iterations using the Rally 2.0 API and a WsapiDataStore object. Even when using fetch: true in development to pull back all fields, I do not see this field.
Does anyone know how to access this field?
Thanks,
Michael
Code excerpt:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
this.loadIterations();
},
loadIterations: function() {
var iterations = Ext.create('Rally.data.WsapiDataStore', {
model: 'Iteration',
autoLoad: true,
fetch: ['ObjectID', 'Name', 'EndDate', 'PlannedVelocity'],
sorters: [
{property: 'EndDate', direction: 'ASC'}
],
listeners: {
load: function(store, data, success) {
Ext.Array.each(data, function(record) {
console.info('ID: ', record.get('ObjectID'),
' Name: ', record.get('Name'),
' EndDate: ', record.get('EndDate'),
' PlannedVelocity: ', record.get('PlannedVelocity'));
});
}, scope: this
}
});
}
});
Console Output:
ID: 12351801409 Name: AGR 4.2 Iteration 1 EndDate: Date {Tue Jul 02 2013 23:59:59 GMT-0400 (Eastern Standard Time)} PlannedVelocity: undefined
ID: 12351802932 Name: AGR 4.2 Iteration 2 EndDate: Date {Tue Jul 23 2013 23:59:59 GMT-0400 (Eastern Standard Time)} PlannedVelocity: undefined
ID: 13298563033 Name: AGR 4.2 Iteration 3 EndDate: Date {Tue Aug 13 2013 23:59:59 GMT-0400 (Eastern Standard Time)} PlannedVelocity: undefined
ID: 12351804786 Name: AGR 4.2 Iteration 4 EndDate: Date {Tue Sep 03 2013 23:59:59 GMT-0400 (Eastern Standard Time)} PlannedVelocity: undefined
Rally Info:
Name End Date Planned Velocity
AGR 4.2 Iteration 1 7/2/2013 29.0 Points
AGR 4.2 Iteration 2 7/23/2013 82.0 Points
AGR 4.2 Iteration 3 8/13/2013 70.5 Points
AGR 4.2 Iteration 4 9/3/2013 72.4 Points

PlannedVelocity is the name of the field to include in the fetch (no spaces). If that still doesn't work please provide some example code so it is easier to see what might be going on.

Related

Axios Get Request Not Working with Json Array Object

I'm trying to fetch second [1] item's title from an object array in JSON:
{
"#attributes": {
"version": "2.0"
},
"channel": {
"title": "Rust News",
"description": "The latest news posts from Rust",
"lastBuildDate": "Thu, 07 Jul 2022 07:00:00 Z",
"item": [
{
"guid": "https:\/\/rust.facepunch.com\/news\/july-2022-update\/",
"link": "https:\/\/rust.facepunch.com\/news\/july-2022-update\/",
"title": "July Update",
"description": "<img src=\"https:\/\/files.facepunch.com\/paddy\/20220705\/july_2022_header.jpg\"><br\/>Combat balance, faster load times, chat filter and much more!\u00a0\u00a0",
"pubDate": "Thu, 07 Jul 2022 07:00:00 Z"
},
{
"guid": "https:\/\/rust.facepunch.com\/news\/community-update-243\/",
"link": "https:\/\/rust.facepunch.com\/news\/community-update-243\/",
"title": "Community Update 243",
"description": "<img src=\"https:\/\/files.facepunch.com\/errn\/1b1311b1\/FTTfqglWQAMxkzD.jpg\"><br\/>Custom desk mats, Mars monuments, thoughtful poetry, and more!",
"pubDate": "Wed, 15 Jun 2022 12:00:00 Z"
}
...
Here is the axios code:
mounted() {
this.axios.get("./api/feedRust.php").then(response => {
this.items = response.data.channel;
});
}
Everything works as expected when tusing response.data.channel, however unable to fetch any object from item array due to this error:
Cannot read properties of undefined (reading '1')
HTML/Vuejs code:
<div>{{items.item[1].title}}<div>
What could be wrong here?
You need to make sure you defined data with the property, because while fetching the response data, it will try to access the items.item, which may not exists with the index.
Add the conditional statement.
Like this:
<div v-if="items.item && items.item.length > 1">{{items.item[1].title}}<div>

How to find the time when an order was fulfilled?

When getting the order information form the api we get the fulfilment status but not the exact time when the order was fulfilled. The fulfilment information from the api is missing.
The fulfilment object in an order has the following properties.
fulfillments: [
{
id: NUMBER,
admin_graphql_api_id: 'gid://shopify/Fulfillment/NUMBER',
created_at: '2022-01-04T11:07:59-05:00',
location_id: NUMBER,
name: 'STRING',
order_id: NUMBER,
receipt: {},
service: 'manual',
shipment_status: null,
status: 'success',
tracking_company: 'ACME',
tracking_number: 'NUMBER',
tracking_numbers: [Array],
tracking_url: 'https://acme.com/TrackConfirmAction?qtc_tLabels1=NUMBER',
tracking_urls: [Array],
updated_at: '2022-01-04T11:08:00-05:00',
line_items: [Array]
}
],
created_at has the information when the fulfilment was created and updated at could have the information when it was even shipped/delivered. How do I get this time, pointers to documentation would be really appreciated.

How do I use PhantomJS with Aurelia?

When I switch from Chrome to PhantomJS I get the following errorh
Starting 'unit'...
03 08 2016 21:39:43.629:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
03 08 2016 21:39:43.643:INFO [launcher]: Starting browser PhantomJS
03 08 2016 21:39:44.355:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket /#ns0iei_Fprf487aCAAAA with id 15517298
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
SyntaxError: Expected an identifier but found 'originalDefine' instead
at /home/xenoterracide/IdeaProjects/rpf-ui/test/aurelia-karma.js:49
{ uid: 0,
name: 'unit',
branch: false,
error: 1,
duration: [ 1, 91922852 ],
time: 1470278384500 }
1
Here is the karma.conf.js generated by Aurelia.
"use strict";
const path = require('path');
const project = require('./aurelia_project/aurelia.json');
const tsconfig = require('./tsconfig.json');
let testSrc = [
{ pattern: project.unitTestRunner.source, included: false },
'test/aurelia-karma.js'
];
let output = project.platform.output;
let appSrc = project.build.bundles.map(x => path.join(output, x.name));
let entryIndex = appSrc.indexOf(path.join(output, project.build.loader.configTarget));
let entryBundle = appSrc.splice(entryIndex, 1)[0];
let files = [entryBundle].concat(testSrc).concat(appSrc);
module.exports = function(config) {
config.set({
basePath: '',
frameworks: [project.testFramework.id],
files: files,
exclude: [],
preprocessors: {
[project.unitTestRunner.source]: [project.transpiler.id]
},
typescriptPreprocessor: {
typescript: require('typescript'),
options: tsconfig.compilerOptions
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: false
});
};
I ran into this issue just now. I 'solved' it by modifying aurelia-karma.js at line 49 from:
let originalDefine = global.define;
to:
var originalDefine = global.define;
Currently don't have time to find a root cause for this, may come back and edit later. Suspect this might be a typescript/transpiling issue with let compatibility.
(Node v4.4.7, Karma 0.13.22, jasmine v2.4.1, Aurelia-cli v0.17.0)

Adjusting User Context with TreeStoreBuilder

I've been able to create a grid and basic filtering to narrow down iterations etc. Ideally I would like to run this via html/confluence so ideally I need to have the filtering set so that I can filter on parent as well as project. Testing this in the Rally dashboard, the way I have it still only working within project I'm sitting in. How do I make my filtering work so that where I'm at project wise in Rally doesn't matter or if I use my api key.
Thanks!
Mark
Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({
models: ['userstory'],
autoLoad: true,
enableHierarchy: true,
filters: [{property: 'Iteration.Name',
operator : '=',
value : 'March'},
{property: 'Project.Parent.Name',
operator : '=',
value : 'Synergy'},
{property: 'Project.Name',
operator : '=',
value : 'Condor'}
]
}).then({
success: function(store) {
Ext.create('Ext.Container', {
items: [{
xtype: 'rallytreegrid',
columnCfgs: [
'DisplayColor',
'Name',
'ScheduleState',
'Blocked',
'TaskEstimateTotal',
'TaskRemainingTotal',
'Owner',
'Notes'
],
store: store
}],
renderTo: Ext.getBody()
});
}
});
You just need to pass a context to your store:
https://help.rallydev.com/apps/2.0/doc/#!/guide/data_stores-section-scoping
All projects:
{ project: null, workspace: '/workspace/12345'}
Specific project:
{ project: '/project/12345', projectScopeDown: false, projectScopeUp: false }
Project hierarchy:
{ project: '/project/12345', projectScopeDown: true, projectScopeUp: false }
Or if you are trying to get data from multiple projects not in a tree you can always create a filter in the store on Project like you're doing above. Note that you'll need to make sure all those projects are actually in scope based on your context to get any results.

Waterline unique validation not detected until the next sailsjs server reset

I am using sails#beta.
I am trying to create several Room models (see definition) below, the problem is that I can successfully create Room models with the same attribute 'name', although attribute 'name' has a unique validation.
The validation isn't detected until the next restart of 'sails' server, then I get this output:
C:\eMali_dev\server>sails lift
info: Starting app...
Express midleware for passport
Waterline encountered a fatal error when trying to perform the `alter` auto-migration strategy.
In a couple of seconds, the data (cached in memory) will be logged to stdout.
(a failsafe put in place to preserve development data)
In the mean time, here's the error:
Error (E_UNKNOWN) :: Encountered an unexpected error:
MongoError: E11000 duplicate key error index: eMali_beta_dev.room.$name_1 dup key: { : "e1" }
Details:
{ error: 'E_UNKNOWN',
summary: 'Encountered an unexpected error',
status: 500,
raw: 'MongoError: E11000 duplicate key error index: eMali_beta_dev.room.$name_1 dup key: { : "e1" }' }
================================
Data backup:
================================
[ { name: 'e1',
center: '53471e2318b931dc1b69f3a8',
min_age: 1,
max_age: 6,
createdAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
updatedAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
_id: { _bsontype: 'ObjectID', id: 'SG\u001e#\u001811Ü\u001bióc' } },
{ name: 'e2',
center: '53471e2318b931dc1b69f3a8',
min_age: 1,
max_age: 7,
createdAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
updatedAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
_id: { _bsontype: 'ObjectID', id: 'SG\u001e#\u001811Ü\u001bióª' } },
{ name: 'e1',
center: '53471e2318b931dc1b69f3a8',
min_age: 1,
max_age: 6,
createdAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
updatedAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
_id: { _bsontype: 'ObjectID', id: 'SG\u001e#\u001811Ü\u001bió«' } } ]
error: A hook (`orm`) failed to load!
Room model:
module.exports = {
schema: true,
attributes: {
name: {
type: 'string',
required: true,
unique: true,
minLength: 3
},
center: {
model: 'center'
},
min_age: {
type: 'integer',
required: true
},
max_age: {
type: 'integer',
required: true
}
}
}
This was a bug in sails and it was fixed. Thanks everybody
You need to change the database from default Disk database to a database of your choice.
I was facing a similar problem and changing database from "Disk" to "MongoDB" fixed my issue.
It seems the default database is unable to enforce unique constraint.
I hope it solves your issue.