TFS2015 - List how many times tags were used in TFS 2015 On-Premise work items - sql

​Hello,
​I am trying to write an SQL query to list all tags along with the number of how many times they were used in Work Items in TFS2015.
I cannot find the connection between tbl_WorkItemCoreLatest, tbl_PropertyDefinition and tbl_TagDefinition that would point me to tags used on work items.
I tried to go with the solution from here, but with no success. The query results seems not to match what I see directly in VSTS (eg. searching for a particular tag returns me work items from which some don't have that particular tag, almost as if TFS would store previous states of work items...?)
If there's a way to do that with REST API, that will work as well.
Any help will be much appreciated.

You can use TFS REST API below to get all work items with System.Tags field, then calculate how many times they were used:
`http://tfs2015:8080/tfs/DefaultCollection/teamproject/_apis/wit/reporting/workitemrevisions?fields=System.Tags&includeLatestOnly=true&api-version=2`
Another simple way is creating a work item query with Tags column and open this query in Excel to filter the Tags column.

Related

How can I pull all work items currently or previously associated with a Sprint in Azure DevOps

I am attempting to retrieve all work items currently or previously associated with a given Iteration from Azure DevOps, either through an in-system query or through the API. I need this information to calculate sprint predictability metrics.
As far as I can tell, ADO only stores the latest Iteration in the work items fields, so the API call to ask for tickets associated with a Past iteration does not include any tickets that may have been moved to a different iteration mid-sprint. Likewise, they query options do not allow for something like a "was" operator to test for work items with may have met the criteria in the past.
Short of pulling each work item history individually through the API and creating my own iteration timeline for all tickets in the system, how can I get this information?
Take a look at this. You have to use the "was ever" operator in the iteration path. To do so, you have to query for it using the WIQL-Syntax.
So you'll have to add
...
AND (
EVER (
[System.IterationPath] = #currentIteration('[YourTeam]\... <id:...>'))
to the WHERE part of the query.
If you want to see an extended example, look here

SSRS Report won't compile if 20+ values selected in multi-valule parameter

I am working on an SQL report that uses a multi-value parameter that contains a total of 41 users. The report works fine if I select 1 or up to 19 total users, but breaks if 20 or more are selected from the list.
By break I mean it attempts to execute for 40+ minutes before I kill it). When running for 1 or for 19 users the report takes 1:10 to run.
I am using two datasets.
One - my main query in which the parameter is used.
Two - The second query to acquire the list of users for the SSRS parameter.
I use this method frequently with no issues for things like locations, insurances, etc.
The parameter is called in a WHERE statement like so: AND EventUserID IN (#user)
If I comment that line out and use: AND EventUserID IN ('KTR','GORCN',......) with the full list of usernames that were acquired with the same query that is being used in the second dataset it works fine and will return the full report.
I have tested it with different groups of users to make sure that one of the users weren't breaking it, but that didn't matter. I also should mention that the query for the second dataset is one I used from another report that uses it the same exact way. That report will run fine will all users selected (parameter properties are set the same).
I am working with MS SQL Server and MS Visual Studio. More details can be provided if necessary.
Thanks in advance for your time and assistance.
This looks like an issue I came across a while back. You essentially have a limited number of parameters you can pass back to SSRS.
Here's some similar issues:
https://blogs.msdn.com/b/johndesch/archive/2012/05/16/webpage-error-when-running-a-parameterized-report-with-parameters.aspx
You can increase this from the web.config file though
https://epmainc.com/blog/ssrs-reports-error-when-large-number-parameters-are-passed
Basically you want to add a section in your web.config file inside the <appsettings/> section:
add key="aspnet:MaxHttpCollectionKeys" value="9999"
That 9999 value should represent the number of parameters that you believe will be used.
If using SharePoint integration Mode: C:\inetpub\wwwroot\wss\VirtualDirectories\\web.config
If using SSRS native Mode: C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer.

ATTASK/WORKFRONT - API - This "is not a top level object"

This sample will give me ALL the GUIDs for HOURS (Yes over 2000 you need to page to get the rest)
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/hour/search?$$LIMIT=2000&fields=ID:*
Object=Hour
field=ID:* (wildcard for all)
If I wanted to do the same thing to SCANS (ScoreCard Answer)
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/scans/search?$$LIMIT=2000&fields=ID:*
Object=scans (Scorecard Answer)
Field=ID:* (Wildcard All)
I get an error:
{"error":{"class":"java.lang.IllegalArgumentException","message":"SCANS is not a top level object and can't be requested directly in internal"}}
I Can do this to pull a ton of project information and I have to parse it all such as produced by this code.
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/proj/search?fields=alignmentScoreCard:,alignmentValues:,alignmentValues:scoreCardQuestion:*
And if I click thru it I can find a ID for a scans and a scoreq and if I take that scans or scoreq and attempt to pull it using the field=ID or
htps://YOURCOMPANY.attask.com/attask/api/v4.0/scans/YOURGUIDHEREXXXXXXXXX/
This again tells me:
{"error":{"class":"java.lang.IllegalArgumentException","message":"SCANS is not a top level object and can't be requested directly in internal"}}
I can pull just about anything and get a list of ID's and then manually pull those items by ID but the scores/scorecard answers/scorecard questions (Even as the API seems to indicate that I can pull this like anything else does NOT allow me to do so?
Suggestions? I know its all associated with projectIDs and such I just want to get a list of them all and work with the ones that I want on a one - one basis without having to pull the PROJ and then rummage thru to locate all the ID's associated with it (If there are one or many) Is this possible?
Thank you!
I don't think there is any workaround for this..
you have to go via projects only..
I am also searching a method for this...
I had to update scorecard answers and I had to go via projects..

SRSS: Dynamic amount of subreports in a report

it might be possible I'm searching for the wrong keywords, but so far I couldn't find anything useful.
My problem is quite simple: At the moment I get a list of individual Ids through a report parameter, I pass them to a procedure and show the results.
The new request is like this: Instead of showing the list for all individuals at once, there should be a list for each individual id.
Since I'm quite a beginner in srss, I thought the easiest approach would be the best: Create a subreport, copy the shown list, and create a subreport per individual id.
The amount of this IDs is dynamic, so I have to create a dynamic amount of subreports.
Funny enought, this doesnt seem to be possible. This http://forums.asp.net/t/1397645.aspx url doesnt show exactly the problem, but it shows the limit of the subreports.
I even ran trough the whole msdn pages starting http://technet.microsoft.com/en-us/library/dd220581.aspx but I couldnt find anything there.
So is there a possibility, to create a loop like:
For each Individual ID in Individual IDs, create a subreport and pass ONE ID to this?
Or is there another approach I should use to make this work?
I tried to create a 'Fake'-Dataset with no sql query but just for iterating the id list, but it seems the dataset needs a data-source...
As usual, thanks so far for all answers!
Matthias Müller
Or is there another approach I should use to make this work?
You didn't provide much detail about what sort of information needs to be included in the subreport, but assuming it's a small amount of data (say, showing a personnel record), and not a huge amount (such as a persons sales for the last year), a List might be the way to go.
I tried to create a 'Fake'-Dataset with no sql query but just for iterating the id list, but it seems the dataset needs a data-source...
All datasets require a data source, though if you're merely hard-coding some fake return data, any data source will do, even a local SQL instance with nothing in it.

How can I get a list of SQVI queries by User ID?

Just as some background, I intend to write an Excel add-in with .NET that can execute queries from an SAP system.
Thus, I'm looking for a list of function modules for SAP's SQVI transaction. I can't seem to find much information about them; the few forum posts I had found before seem to have gone into the internet oblivion.
Specifically, I want to be able to look up the queries created by a user and then display the results in Excel. I can manage the Excel manipulation as well as remotely executing SAP function modules; I simply can't find which SQVI function modules I need to execute.
Update: I did find this post which directed me to search for function modules in the AQGF group (function modules starting with RSAQ*)
Try RSAQ_REMOTE_QUERY_CALL_CATALOG, it seems to do the trick for me.
As told already by tomdemuyt, you have now found the function to get the required data.
To browse around and get more further data, goto transaction SE93, enter Transaction id SQVI, go to development class or package SQUE, then browse this package with SE80 / have a look at the hierarchy of objects, function groups in special.
Then you see many function groups, but one of them is AQRC to which the mentioned function module RSAQ_REMOTE_QUERY_CALL_CATALOG belongs.
A list of SQVI Queries by User can be found simply using the following selections in transaction SE16N for table AQLTS.
AQLTS-CLAS = ‘SYSTQV*’
AQLTS-HEAD = ‘X’
It is not the ideal way to retrieve the data, because a single field (AQLTS-TEXT) must be parsed for the userID:reportID, but it brings what is needed together in one table.