Applying tdfilter to user-interface...is this doable?
Hello all - this is related to QC/ALM 11.00
Based on my research, I believe the answer is "no", but i want to ask anyways, b/c I have seen this same question being asked several ways.
Is it possible to apply a filter built in the OTA layer to the user-inferface (GUI)? I would like to create a button that runs a UDF to toggle between 2 statuses. I realize the functionally I am describing is the same as creating a public or private view (favorite), however, I am just looking for another way to achieve those results. I have not had any issues creating the filter, as seen below, however, the part that no one seems to have an answer to is how to take the filter and have it applied to the UI. I spent some time understanding how to get a refresh to occur programatically, but if there is no means to get the filter applied, I will finally let this one go. I am using a very basic filter for this example.
dim bugfact, bugfilter, buglist
set bugfact = tdc.BugFactory
set bugfilter = bugfact.filter
bugfilter.filter("BG_STATUS") = """OPEN"""
set buglist = bugfilter.newlist("")
'is there a commit or execute command i can use here to apply bugfilter to the UI?
'i tried Actions.Action("act_refresh").execute and Actions.Action("defects.refreshall").execute, both refresh the screen, but they dont apply the filter
set buglist = nothing
set tdc = nothing
To set the filter in the Defects module of the QC/ALM UI, you can use the undocumented workflow function SetDefectsFilter. In your case, you'd use the bugfilter.Text property as the one and only parameter.
You can get the current defects filter at any time with s = GetDefectsFilter().
Could this be applied to requirements as well? I'm thinking the following:
I have an UDF which is Assigned To (user list).
I'd like to get a filter by default that's set to current user assigned to value only. In essence only see what's assigned to me (while the actual assignments are done by a 3rd person).
Please let me know soonest.
Thank and regards,
There is no equivalent to SetDefectsFiter for the Requirements module.
However, I *think* that you can set a default filter at login time : set such a filter for your user (I guess you can set it to Assigned To = [Current User]), then have a look at the FAVORITES table ; you should find the data you need to set for other users. You should be able to read/write the data by using the hidden method TDConnection.GetFavoriteFactory.
Thanks for the insight on the undocumented function. I look forward to working with this new information! For my current task, I wanted to accomplish something similar to what Mihai is describing, except i went with tdconnection.userslist, which I compare to users in a custom list, and will eventually filter based on whats found. Basically, I *want* to create an "active users" filter that users can toggle on/off using a button in the toolbar. My current QC instance has 5000+ defects of various status (not all are active), and 400+ users. I am about to clean up the users list and remove users who no longer need access, but I need to preserve all historical defects that were created, hence a filter that is based on users in a custom project list. Using the CanLogin function, I am checking members of tdconnection.userslist object against a user defined list, adding them to the list if needed, and them moving on. Once the list is built, i hope to be able to apply it as a filter. I dont have all the logic working, but will post something soon. Any thoughts on feasibility?
Last edited by wherbjr35; 05-23-2013 at 05:44 AM.
Reason: Correcting synyax used
It would probably be easier to create a new users group based on the Viewer group (so as not to grant new permissions). Let's call it "Active Users". Add all active users to that group. Then filter on Assigned To = "[Active Users]".