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
Related
The CRM365 Form displays a convenient document template dropdown button where a number of actions could be initiated. Additionally, it displays the list of already existing document templates. The user can select one template in the list and it is downloaded locally by your browser. So far all good.
Our goal is actually to select the template, retrieve it, and create it in a Document Management repository. We have a working solution for this but it involves too many pieces and steps so we are looking for some better ideas.
Ideally we are looking for a solution where we can:
"intercept" the click on the template item and run a JavaScript function
If we find a solution to this, the rest would be just calling our custom workflow to do the rest of the job.
So, is there any way to hook that "select/click" event from the form menu?
Thank you very much for your help and advice.
I have a website hosted on AEM. I want to change a text that is present in almost all pages (say I want to change my product name which is present in all pages) . How can i do it. It can either be a Groovy/Java code or an ondeploy script or anything else. Because doing it manually on all pages at multiple locations is not feasible. Will AEM Bulk Editor solve the purpose?
Its like Find and replace functionality in office
Yes, you will need to have a set of queries to find most of the references and then make a POST to these pages with the new value.
Example with: curl -u $USER:$PASSWORD -F"PROPERTY=new value" "http://$HOST/content/mysite/en/page/jcr:content"
Of course, you can do it with Java, Groovy (look for Groovy Console for AEM, which is very convenient), or even bash for simpler cases.
You can write a query using the query builder api to get all the nodes where your particular property is present.
Then once you get the path to that property you can update that using the node api.
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.
I'm in the process of recreating the Work Item creation UI in my web app. The UI includes a lot of drop down menus. My choice right now is either to hardcode all of the options available, or retrieve them and dynamically populate. I would like to populate them dynamically, but that would require me to retrieve the possible options for each drop down menu. Is there a way to retrieve these through the API?
There's no direct rest api for this. If you want to retrieve the possible WorkItem types in current project, you should 1.first get the processID of current project and then 2.list the WorkItem types in specific process.
If you're using rest api like your tags above: You can consider using Processes-List to get the processID and List Work Items Types to get the available WorkItem types in one project. We can't do that directly in one api, no matter rest api or client api.
Just to follow up on this:
This document answers the question:
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20item%20types%20field/list?view=azure-devops-rest-5.1
We can retrieve the allowed values for our field through the API query GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitemtypes/{type}/fields?$expand={$expand}&api-version=5.1
My issue now is that the allowed values for one of my drop-down menu depends on the value of another. For instance, if I selected X in one of my drop down menus, the allowed values for my other drop down menu changes dynamically. I'm not sure how to handle this using the API.
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.