Query allowed values of an attribute in Rally using javascript - rally

Could someone tell me how to query allowed values of an attribute in Rally using javascript?
Particularly, I want to query all possible states of a Defect
I know that it can be done with REST api
DynamicJsonObject allowedValues = restApi.GetAllowedAttributeValues("defect", "state");
Is there a javascript equivalence?

You can use RallyDataSource from the App SDK (note, this is the original one, not the new ExtJS-based SDK currently in preview). See the Attribute Values example on this page:
http://developer.rallydev.com/help/data-examples

You may wish to try something along the lines of:
queryConfig = {
type: 'Defect',
key : 'defectStates',
attribute: 'State'
};

Related

Podio API JS - Update relationship field of a Item

Using NodeJS, I am trying to update relationship field which link to another app (contacts-leads). I have try all combination but still getting error. I think I have the necessary data to post, app_id, item_id, external_id..etc. I need help with forming JSON structure.
p.request('put','item/<Item_Id>/value', data)
var data {....}
app_id:'<app_id>'
value:'<value>' (value is the app_item_id of the link to application; that is the number in URL)
app_item_id: '<app_item_id>'
external_id:'<external_id>'
I was able to update non-relationship field without problem.
Thanks
Well, going to answer my own question. That will work for single app link, not sure about multiple ones.
data = {
"<external_id>": {
"apps": [{"app_id": <app_id>}],
"value: <app_item_id>
}
}

swagger-ui sort API not working Version 1.3.12

I want to sort my API method in alphabetical order.
Int the doc it say that you just have to put :
window.swaggerUi = new SwaggerUi({
// ...
sorters : "alpha" // or sorter I've tried both
});
The post is already related here.
But in my case this is not working at all and it is today quite difficult to find an API in swagger-UI.
And if I don't know if I update my swagger-ui version if i need to upgrade swagger too. In this case I cannot do this...
Any ideas ?
From their GitHub page, the correct key seems to be apisSorter and not sorters:
window.swaggerUi = new SwaggerUi({
// (...)
apisSorter : "alpha"
});
Finally I have to upgrade my swaggerUI version, no choice... Thanks you Salem

Wsapi data store query

I am looking to get all projects under a selected project (i.e the entire child project branch ) using Wsapi data store query in Rally SDK 2.0rc1. Is it possible using a query to recursively get all child project names? or will I have to write a separate recursive function to get that information? If a separate recursive function is required, how should I populate that data into for example, a combo box? Do I need to create a separate data store and push the data from my recursive function in it and then link the Combobox's store to it?
Also, how to get the "current workspace name" (workspace that I am working in, inside Rally), in Rally SDK 2.0rc1 ?
Use the 'context' config option to specify which project level to start at and add 'projectScopeDown' to make sure child projects are returned. That would look something like this:
Ext.create('Rally.data.WsapiDataStore', {
limit : Infinity,
model : 'Project',
fetch : ['Name','ObjectID'],
context : {
project : '/project/' + PROJECT_OID,
projectScopeDown : true
}
}).load({
callback: function(store) {
//Use project store data here
}
});
To get your current context data, use: this.getContext().
var workspace = this.getContext().getWorkspace();
var project = this.getContext().getProject();
If you try exposing with console.log the this.getContext().getWorkspace() and this.getContext().getProject() you may understand better what is returned and what is required. In one of my cases I had to use this.getContext().getProject().project.
Using console debug statement is best way to figure what you need based on its usage.

some questions about Extjs 4.0.7

I want to implement a dynamic column in grid panel, how can I do it? I used Extjs 4.0.7:
var result = Ext.JSON.decode(response.responseText);
store.model.setFields(result.fields);
grid.reconfigure(store, result.columns);
store.loadRawData(result.data, false);
The method setFields() doesn't exist in version 4.0.7
Try something like :
var store = new Ext.data.Store({fields: result.fields, data: result.data})
grid.reconfigure(store, result.columns})
The fields config on Store has always behaved this way, with the ability to pass in fields instead of a model. http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.AbstractStore-cfg-fields

how can I obtain all tags in rally api

We use tags to identify our completed user stories. Now we have a need to automatic that process by querying tags and generate a list of user stories that associate to that tag.
I have found the following link very useful:
Rally: Query Filtered to Specific Tags
However, I'd like to somehow query Rally so I can get a list of all the tags first so users has the freedom to pick a tag they want to query. Any idea how to accomplish that? Thanks in advance.
If you are using SDK 1.0 you can use the code below to get all allowable tags. All you should have to do it supply a function named "callback" to handle your results.
queryConfig = {
type : 'defect',
key : 'defects',
query: '(Archived = false)',
fetch: 'Name,Priority'
};
var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
'__PROJECT_OID__',
'__PROJECT_SCOPING_UP__',
'__PROJECT_SCOPING_DOWN__');
rallyDataSource.findAll(queryConfig, callback);