How to display custom fields in rally? - rally

I have a ruby script that is trying to pull up some custom fields from Rally, the filter works just fine ( the filter contains one of the custom fields i want to pull up) but when I try to display it, it doesn't show up in the list (the value returned for all custom fields is blank, while appropriate values are returned for FormattedID, Name, Description).
Here's the link [link]http://pastebin.ubuntu.com/6124958/

Please see this post.
Do you fetch the fields?
What version of WS API are you using? If it is v2.0 is c_ prepended to the name of the field in the code?
How is the field spelled in your code and how that spelling compares to Name and Display Name of the field in UI?

There is another reason why custom fields might not appear (other than the versioning and 'c_' issues nickm mentioned). I just found this out after a ton of head banging. The Rally SDK's ui stuff will filter out all fields that are hidden (such as _ref, or other 'hidden' custom fields) so you cannot view them in your apps in grids, charts, etc. For example, when constructing a Rally.ui.grid.Grid, a class called Rally.ui.grid.ColumnBuilder is constructed and it executes a command on the columns of the chart that look like this:
_removeHiddenColumns: function (columns) {
return _.filter(columns, function (column) {
return !column.modelField || !column.modelField.hidden;
});
},
As you can see, if you try to display any fields that are hidden (like _ref for example) in a grid, the column gets removed. So, although you may be fetching the custom fields, they will not show up unless those fields are not 'hidden'.

Related

odoo filter one2many list

I have a long one2many list and want to show only a subset of this to the user, based on filters that the user may set.
My current approach is to have the original one2many field with all records, and another filtered one2many field.
I compute the filtered list by selecting the subset that is not filtered from the original list.
Further I apply the changes from the filtered list to the original list. So I search for new records in the list and create those as well in the original list. I search for deleted records and delete them from the original list.
This approach works actually, but it requires a bunch of code and only mimics what I would expect from either some native Odoo features or a filterable one2many widget.
Sadly all other approaches I tried did not work:
Searching in one2many lists does not work (e.g. setting search_default_ values in the context). I think it is not supported.
Using a domain to filter the second one2many list does not work (neither in xml nor python code). I think Odoo only allows this for many2many.
I would like to create a filterable one2many widget by extending the normal one. However I don't understand where in the js code the list is populated.
So question is: Is there an easier solution than my current approach to filter a one2many field with native Odoo features?
Or can you help me with the js code of a custom one2many widget to only show a subset of items? For instance, which method is called when the list is populated and in which field are the ids of the items?
Example
I want in my model something as the following:
# This is the original list, with all entries
schedule_entry_ids =
fields.One2many('mymodule.schedule_entry', 'schedule_id', string="Entries")
# This is the filtered list, to be used in the view
# Note: Sadly using the domain here does not work. It always shows all entries. But I hope you get the idea what I want to accomplish.
filtered_schedule_entry_ids =
fields.One2many('mymodule.schedule_entry', string="Filtered Entries", related='schedule_entry_ids', domain='[("phase_id", "=", filter_phase_id)]')
# This is the field that defines the filter
filter_phase_id =
fields.Many2one('mymodule.phase', string="Phase Filter")
Sadly using the domain filter does not work, so my approach at the moment is to create the filtered field as a computed field 'by hand':
filtered_schedule_entry_ids =
fields.One2many('mymodule.schedule_entry', string="Filtered Entries", compute='_compute_filter', inverse='_inverse_filter')
#api.onchange('filter_phase_id', 'schedule_entry_ids')
def _compute_filter(self):
# Populate the filtered list with the elements from the original list, for which the filter condition holds
def _inverse_filter(self):
# Remove elements from the original list if they should be present in the filtered list but aren't anymore (elements have been deleted from the filtered list).
# For all new elements in the filtered list, create a new element in the original list (elements have been created)
I tried all the tricks you mentioned with the same result...
The only workarounds (wich works!) I found is explained below:
1- You can use compute in ..._ids field definition
and put all the 'filtering stuff' in the def
but all lines on 'many' side will be read-only
(it's a problem for me because I need to edit these lines
2- You can define a new computed boolean field on the table wich is
on the "many" side (in your case 'mymodule.schedule_entry') and put
the 'filtering stuff' in the def. It works perfectly and the lines are editable !

#Dblookup and formatting on web

I have been developing a web application using domino, therein I have dblookup-ing the field from notes client; Now, this is working fine but the format of value is missing while using on web.
For example in lotus notes client the field value format is as above
I am one, I am two, I am one , I am two, labbblallalalalalalalalalalalalalalalalalalaallllal
Labbbaalalalallalalalalalaalallaal
Hello there, labblalalallalalalllaalalalalalalalalalalalalalalalalalalalalalalala
Now when I retrieve the value of the field on web it seems it takes 2 immediate after 1. and so forth, I was expecting line feed here which is not happening.
The field above is multi valued field. Also on web I have used computed text which does db lookup from notes client.
Please help me what else could/alternate solution for this case.
Thanks
HD
Your multi-valued field has display options associated with it and the Notes client honors those. Obviously, your options are set up to display entries separated by newlines.
The computed text that you are using for the web does not have options like that and the field options are irrelevant because you aren't displaying the field. Your code has to insert the #Newlines. That's pretty easy because #DbLookup returns a list, and if you concatenate a list and a scalar, the scalar will be appended to each element of the list. (Look at the third example under "concatenation, pairwise" here to see what I mean.
The way you've worded your question is a little unclear to me, but what you need in your computed text formula is either something like this:
list := #DbLookup(etc,. etc.);
list + #Newline;
Or something like this:
multiValueFieldContainingListWithDbLookupResult + #NewLine;
I used #implode(Dblookupreturnedvalue;"");
thanks All :)

yadcf externally triggered filters 'shut off' the actual filtering

I am trying to set my yadcf filters up so they can be triggered from a call (link) from another page. I have an angular single page application that has three tabs on it. If a user clicks a link on lets say the first tab, they will go to another tab (separate table) that contains detailed information relevant to the link they click. (e.g. They are on a row in a table that deals with Apple Mac Pro computers. They see that there are 20 skus currently in the system. They click the number 20 and they go to a lower tab (different table) that contains all the information for those skus). There is no server call in the middle. All the data is loaded in all the tables when the application loads up. So, they are simply clicking a link that applies a filter to the detail table.
yadcf can do this through externally_triggered filters. However, when I set 'externally_triggered': true, it stops the actual filters from working on the details table. (In other words, I can no longer go to that table and manually adjust the filters.)
Does anyone know a way around this issue?
It appears the externally_triggered: true switch does not need to be turned on to use yadcf.exFilterColumn() method. I do not understand when it does need to be turned on, but I am able to call the exFilterColumn method and pass it the options needed to 'prefilter' the table while still retaining the ability to filter the table manually.
externally_triggered and yadcf.exFilterColumn are not related in any way, indeed when yadcf.exFilterColumn is used filters behave a bit differently - they are not filtering on change/keyup/etc , but rather only when the uadcf.exFilterExternallyTriggered function is called (its on purpose and all is explained in the docs)
Here is the relevant text from the docs of the externally_triggered, here it is:
* externally_triggered
Required: false
Type: boolean
Default value: false
Description: Filters will filter only when yadcf.exFilterExternallyTriggered(table_arg) is called
Special notes: Useful when you want to build some form with filters and you want to trigger the filter when that form
"submit" button is clicked (instead of filtering per filter input change)
Here is the showcase page

YouTrack rest api - Get fields metadata

I want to create issues with the youtrack rest api,
Currently I'm using:
PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}
but I want to set other fields (priority, type, subsystem...)
How do I get a list of available fields from the api? and the fields metadata(is mandatory, field type...)?
And after that, How do I set the value of these fields?
I found this in the docs:
https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue
but it looks too complex for setting a field.
Issue can be created with following method and fields set only https://confluence.jetbrains.com/display/YTD6/Create+New+Issue . So as you mentioned, it's
PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}
It's assumed, other fields can be updated within next call. ApplyCommand (https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue)method is pretty good example of such a method.
If you need to know all available fields in the projects, here is the method https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Fields.
Meta can be called with the following https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Field. As you can see, details are available on per field basis.

Rally Create custom view based on presence of description

I am trying to identify the list of stories that do not contain any text in the "Description" field. This would be part of a report that specifies which stories are "incomplete".
In case you are interested to know why I need this:
We are facing this issue every now and then in some of our projects. Getting some basic information filled in helps reduce the time spent in iteration planning and backlog grooming meetings.
Per WS API documentation Description is of type Text and it only formally supports contains, !contains operators. !contains is not intended to return artifacts with empty text field.
!= and = operators are not supported by Text field. Nevertheless != null works with Description, while it does not work with custom fields of type Text.
This query:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=(Description%20%3D%20null)&start=1&pagesize=20&fetch=Description
will return stories with empty description.