Use Followed work Item in a new Query TFS 2017 - azure-devops

I want to create a query with my followed works items in TFS 2017, but I didn't find the field name for the followed state.
I want to create that query in order to add a new widget in home dashboard.
Is it possible to make a query with your followed items in TFS2017?

No, there isn’t the feature to create a query with followed work items in TFS or VSTS and pin to dashboard. You just can check followed work items from Work>Queries.
I submit a user voice here (Query for followed workitem and pin to dashboard), you can vote it.

You can achieve this scenario by creating a custom Followed work items query (System.ID In #Follows) and saving it to Shared Queries. Then, simply pin the query to your dashboard as a Query Results Widget and anyone who views it will see their followed work items (similarly you can pin an Assigned to me query using the #me macro and users will see items assigned to them).
The #Follows macro has been around in VSTS for awhile and was introduced in TFS 2017. Check out our documentation on queries macros for more information.

As proposed by Lauren, in TFS 2017, you can build an ad-hoc query "ID In #follows" (Field=ID / Operator=In / Value=#follows). The results will be similar to the Default Query "Followed work items" under Work>Queries.
However, I was never able to save this query: trying to save always got me an error "TF212023: You cannot compare fields with different data types in the WHERE clause of a work item query. The error is caused by «[System.Id] in (#follows)»."

What I found out is, that the query works well in the web interface, but cannot be run nor created or edited in Visual Studio.
I did not even find a way to "follow" a workitem in VS, this seems to be available only in the web interface as well.

Related

DevOps doesn't show all matching stories/tasks when searching

I can start typing "#per" in a Devops task description/comment and it brings up suggestions. However it only shows a subset of all the stories which means the one I want is rarely listed and I have to go look it up.
For instance I have two work items (on the same epic) called "perform analysis" and "determine permutations" but typing "#per" only shows the second one.
Is there some logic used in the searching based on item fields that could be to blame i.e. it's a feature rather than just not working well?
Normally, when using the #mentioned to link work items, the expected syntax is #{ID} instead of #{Keyword}.
If using the syntax #{Keyword}, it may be not able to return the expected result. So, it is recommended using the #{ID} as possible to search and link work items.
For more information, you can reference "Link work items".
[UPDATE]
When you use #{ID} to search and link a work item, normally it will prioritize the work items that you've recently modified or are assigned to you.

Azure DevOps Migration - Moving Project to Another Org

I'm looking to migrate a project from one org to another in Azure DevOps. We've ended up with two or three orgs, and this project that I'm looking to move has all sorts of weird and wonderful work items created and custom fields added. What I'm looking to do is move the project and then see if I can persuade the powers that be that certain things can be dropped but I have an immediate need to move as-is so that reporting and other work isn't impacted.
I have tried to get this to work with the migration tools (and tried to follow the videos) but have hit a dead-end. I think there are two issues potentially. One being the ReflectedWorkItemId. It says that it's not found in User Stories but I'm not sure how to resolve this? Do I go into user stories and add a field called 'ReflectedWorkItemId' and populate it with the work item number and/or add the same field in the destination org process?
It also mentions in the info that it can't find one of the Work Item Types - Processes. There are a few other custom work item types that have been created too but I assume it's given up on the first one. Do I have to create all of the work item types and the custom fields for each work item type in the destination org? Or am I getting the wrong end of the stick with this?
To provide sync as well as migration it is important that the tools knows which items have already been migrated. This is the purpose of the ReflectedWorkItemId field.
The field is not required in either case, however... if you don't have
the field then the system cant be re-run as it will re-copy all
completed work items. If you add the field to the target then it will
only copy those items it cant find. If you add the field to the source
(yes it needs to be the same refname), and set UpdateSoureReflectedId
to true then you can also filter the source, using a query and limit
what you load.
The former prevents duplicates, and the latter allows you to filter
the data load...
This is mentioned in this document. Here is a similar issue you can refer to.
TF201077 that usually happens when the target Project does not have a work item of that name. You can refer to this issue on github for help.

How to access query from query results toolbar menu VSTS extension?

I am trying to write a VSTS Extension which allows me to clone a set of work items including links to a different area path.
To do this I have created an extension that uses the "ms.vss-work-web.work-item-query-results-toolbar-menu" contribution to create a toolbar menu item in the work item query results.
Ideally I would like to know the set of selected work items from the query to perform my clone on, but from what I have read this is not possible. I can live with running the clone on the whole query set, but I have not been able to figure out how to know what query was run from my extension.
How can you access the parent of the extension to know which query was run? I should be fine with running the TFS code to get the query results and perform the clone operation once I have that information.
The documentation for the client APIs is lacking, and the "hello world" examples they always provide do nothing but show the basics of the creation of the toolbar item and not any integration. I have checked through the Core client VSS SDK and could not find any object that contained the parent query.
I am also not able to access the parent URL to get the query from that as the extension runs in an IFRAME and that would be cross site scripting.
I appreciate any help with this.
Well I figured it out. You have to use the actionContext from the callback that gets invoked when your extension is invoked. I haven't found a reference for the actionContext, but by inspecting it in the browser, for the query toolbar menu item you get properties for the query, queryText and workItemIds.
This documentation has an example for the team information:
https://learn.microsoft.com/en-us/azure/devops/extend/develop/web-navigation?view=azure-devops

TFS 2013: Why can't I create charts for "tag" based queries?

I have a simple query that lists out workitems marked with a certain "tag." When I try to create an Area chart for this query, I get the following error:
Is this controlled by my TFS admin? If not, why aren't charts based on "tag" field supported?
There is already a feature request submitted for this on MS User Voice, refer to this link for details: Add trend chart support for tag-based queries.
By the way, this feature is available in TFS2015, you can upgrade your TFS version if you do want this feature.
I'd assume it's because tags aren't actual work item fields, but instead are metadata that can be attached to work items at any time.

How to use LookupSPGroupMembers in Workflow Custom Activity (SharePoint)

I am creating a custom workflow in sharepoint designer 2013 but i have hit a snag where i cant work out a way to check to see if a user belongs to a specific user group.
This has led me to create a custom activity in Visual Studio 2012. There is a built in activity called LookupSPGroupMembers but i can for the life of me work out how to use the output.
The output is of type DyanamicValue, but I cant workout how to iterate through the value to retrieve the users.
HELP!
I found a way, this is complex to explain here, so please check in:
http://raquelalineblog.wordpress.com/2013/05/20/sharepoint-2013-lookupspgroupmembers-workflow-activity/
The result of LookupSPGroupMembers is an array or list of DynamicValues, you have to create the logic to iterate through this list and get the values of each item.