Get users of project - rally

How do I get users (not team members) of a given project using Ruby Rally Toolkit? I am trying to run a query to change the roles of all the users in a given project to "Editor", for that I need to get the list of all users of a project.

Unfortunately there's no easy way to get the list of all Users with ProjectPermissions in a Project. This endpoint:
https://rally1.rallydev.com/slm/webservice/v2.0/Project/12345678910/Editors
Will obtain a list of all Editors in a Project. However that doesn't help very much if you want to promote any Viewers in a Project to Editors - and there's no such collection as:
https://rally1.rallydev.com/slm/webservice/v2.0/Project/12345678910/Viewers
or
https://rally1.rallydev.com/slm/webservice/v2.0/Project/12345678910/Users
Although it would makes sense and be kind of nice if there were.
Unfortunately your only recourse is to query through all Users and their UserPermissions in your Ruby code, examine their ProjectPermissions, and operate on anyone having ProjectPermission.Role = Viewer for the Project of interest. Sorry there's not a better way, at least that I know of.

Related

How to supply data for search bar suggestions

Basically I'm working on my personal project, and I'm building a react native app that serves a very similar purpose to that of eBay's or Gumtree or the like. Users can obviously search for a product, I want to show search suggestions based on what the user types. Search engines usually show suggestions based on what is also being searched by other users, or what data is already is already posted on the site.
Since this is a personal project neither of those two cases apply. I need a way to still provide suggestions to user searches.
One way I tried doing this, is by finding a txt file with a bunch of product names and filtering through that based on user search.
I tried doing the same approach but by using an API instead of a text file.
I couldn't find any resources for either of those 2 methods, so I don't really know what to do
Any suggestions or references to material would be greatly appreciated!

Query to get the list of all user story I had once work on in Rally

I am a developer. I have come across a scenario where I need to get the list of all user stories on which I had worked once but now its owner is some one else like QA. Now those user stories have QA person as owner so I can not write query as [Owner = 'MyName'].
Any idea?
Have you investigated the Lookback API (https://rally1.rallydev.com/analytics/doc/#/manual)? You can query the history of most Rally artifacts to look for ones of which you were once the Owner.
I haven't used Rally but, just thinking : since it was a story you worked on, there's a high chance you have added some comments on it, or possibly even created it yourself.
Is there a way to use this in your query?
For eg - [CommentBy = Adarsh Kumar], or [CreatedBy = Adarsh Kumar]
I use Rational Team Concert, and this may be a problem there too. If one modifies the design where you have a Dev owner, and a FVT owner, and give the ability to query on these two separate fields, it would be easier to track efforts at the end of the year eh? ;-)

Request for Existing Source Code on Defect Trend App

I started modifying/developing Rally apps about a week ago using the existing Rally apps provided on the Github repository so far. However, for one of my final tasks I've been asked to recreate a tailored Defect Trend Report App and unfortunately, the source code is not available for the App. I tried to start from scratch but I've ran into numerous errors and am a bit overwhelmed.
I was wondering if anyone had the src code for the app or knew of a way to extract the src code from the existing app. Of course if there is custom code that an individual has worked on that could also help me progress in this process and wouldn't mind sharing it, that'd also help a ton.
I saw that there were a few snippets that could be used from the Hackathon repo, but they're not quite on the mark of what I want to do with the app. I'm just trying to have the existing app filtered by delivery versions (currently filtered by iteration/release).
All help is greatly appreciated.
Thanks fellas!
There is an example of a 'bare metal' chart app in the App SDK 2.0 docs. It should give you the basics on how to do a chart.To get to it, go to the help pages (click on avatar in top right corner) and search for "Rally App SDK"
After that, you need to work out how to select defects from the various releases and do a count of each. There are two ways to do this:
Get all defects in the project you are in (don't forget whether you need to scope down to child projects too) and then do something like _.uniq() on the release field to find the list of releases (or do another request to get all the releases into a different store and use that for names and a count).
Get the releases and then for each release request the related defects.
If you do ask for child projects, you will need to handle all the scenarios of different releases for different projects - can get complicated!
#1 is effectively one big fetch, #2 may be many smaller ones.
You may want to decide whether to count all defects, sum the estimates, ignore those not finished, etc., etc.

Make item "Private" in rails

App Attributes:
Rails 3.2, Mongoid, Devise, Elasticsearch
Basic Structure:
User has a Post
Post can be seen by other users
Situation:
A User wants to remove the post from being view-able by other users for a period of time.
Note
Eventually I would like to extend this capability so that its possible for said user to be able to make it only viewable to certain colleagues. This way they can collaborate on the post together.
Problem:
I can't seem to think of a good way in rails to do this. One idea I had was to create a Boolean field in the post model that would allow me to achieve some of this but the ACL's would tricky and unstable at best. So I'm reaching out to the great intelligence this should be cake for some of you.
The solution you suggest is the one that occurs to me. Place a boolean flag private on the Post model, and modify the code you use to fetch Posts to exclude ones with the flag set unless they belong to the current user, (depending on whether private posts are viewable by their owner in that particular context).
I haven't actually worked with Mongoid, but I believe this is as simple as Post.any_of({private: false}, {user_id: current_user.id})
If and when you implement the collaboration functionality you discuss, all you need to do is change that code again - fetch posts that are not private, or that belong to any one of a given set of users.

user login before or after main application part?

Theoretical question. Lets say I build an application for managing clients, products, bills and such. All without a user login.
Is it possible to get multi user (each one with his own clients,products,...) functionality after the main application is done?
Or should I think of the multi user in the first place? How flexible is rails at this part?
thanks in advance
dennym
What you are asking for is a pattern called Multitenant. There are different ways to do it, but none are provided by Rails natively.
You could start with this slide: http://www.slideshare.net/tardate/multitenancy-with-rails
And figure out if you want to do; partitioning based on data, Rbac, model or schema.
There are is one that offers it as a service that says that it is easy to do after you have your application: http://railskits.com/saas/
But in our experience, it was a bit outdated and missing some features that we wanted.
You can also take a look at other gems like: multitenant or act_as_tenant.
We ended up using act_as_tenant and doing it from the beginning.