Retrieving all the possible options in a drop-down menu (when creating a work item) through the Azure DevOps API - azure-devops

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.

Related

Bing Map API - Update / Delete Entity

I am trying to use Bing Map API to Update / Delete Entities in an existing Data source, though it is possible, it appears like I have to upload the whole dataset every time after making necessary updates to the relevant entities. Is there an alternative way to update or delete individual entities through API other than using the Bing Maps Dev Center?
Yes.
Log into the Bing Maps dev center.
Select "Data Sources" -> "Managed data sources" at the top of the page.
Locate your data source in the list and click edit.
Go through your data and make edits or delete items as you see fit. Press "Update" button after making a change to an item.
After all your edits are done, press the "Publish" button.
There is a parameter "loadOperation" when invoking the Load Datasource URL
http://spatial.virtualearth.net/REST/v1/Dataflows/LoadDataSource?dataSourceName=dataSourceName&loadOperation=loadOperation&dataLocation=dataLocation&setPublic=setPublic&input=input&output=output&key=masterKey&queryKey=queryKey
If we provide the value "complete" to this parameter it overwrites the entities in the existing data source, however when we provide the value "incremental" it just updates/deletes required entities.
For deleting the entities, we must add a property named __deleteEntity to the schema and set it to 1 or true for each entity that we want to remove.
These details are available in the documentation link

How to auto populate values for a drop down field in Azure Devops?

We have two fields Fix Versions and Affects Version in a bug wherein the drop down values are to be auto populated based on the tags created in Azure Repos. For ex: if there are tags v1.001.560, v1.001.561 etc and for any new tags created, the tag version should appear as a drop down value for these fields. Is there a feasible approach to achieve this? Please suggest.
In short, there is no method to meet your needs now. As a suggestion, you could submit a suggestion ticket to suggest the feature on: https://developercommunity.visualstudio.com/report?space=21&entry=suggestion. That will allow you to directly interact with the appropriate product group, and makes it more convenient for the product group to collect and categorize your suggestions.
DevOps only supports setting to specific values for your custom picklist fields. Please note custom field is used to support tracking data requirements you have that aren't met with the existing set of fields.
Besides, to realize your idea, we should auto populate tag values to the field when opening the work item. However, we also not have such a trigger even though getting the tags with Rest API.

Azure DevOps: Field with default value containing another fields value

I am trying to find a way in Azure DevOps of displaying a field on a User Story layout that is made up of a URL plus the value of another field on the same story.
We have an external support ticket system where all of our support calls are logged. When the story (or even Defect) is created, we have a field where a support reference is entered.
I want another field that combines a URL and the support reference so it creates a link to the support ticket.
Is this do-able?
Thanks,
Craig
This is achievable. You can Add a custom field to a work item type for an inherited process.
1,First you need to create a inherited process.
Go to Organization settings, From the Process page under Boards, open the … context menu of the process you'll use to create an inherited process, and then choose Create inherited process. Choose the same system process—Agile, Basic, Scrum, or CMMI—that was used to create the project that you want to customize.
2, Add a custom field to an existing work item type for the inherited process.
From the Process page of the selected inherited process, choose the work item type(User Story) you want to add the custom field to.
Select the work item type and click new field or ... to add a field under a group.
For example i add a new field Support Url under group Planning(click Options to define a default value for this field).
3, Apply the customized process to your project.
Click team projects of the process shown as below screenshot.
Open the … context menu for the process and choose the Change team projects… option.
Then you will have the custom field with default value for the work item type in your project.
For detailed steps please check Microsoft Document there.
Update:
Field value made up of a static part, plus another field
There is no direct way or any tool i can find to achieve this. However there is a complicate workaround to achieve this.
You can try creating a service server to to combine the field values and update the workitem field with workitem update rest api, and add a service hook to this service server.
You can refer to the service hook sever provided by Microsoft. Check reate a pull request status server with Node.js

Can Azure DevOps Projects be customized?

I would like to add some custom fields to a Azure DevOps Project.
By default, there are only two fields available: Name and Description.
However, I would like to add additional information to the project like internal ProjectNo, OrderNo, OfferNo, Offer Date and so on.
Is there a way to do this?
As far as I'm aware there isn't any way to custom this aspect currently. You could always add it as a suggestion here; https://developercommunity.visualstudio.com/spaces/21/index.html.
Alternatively, depending on what you are looking to accomplish and how you want to use these new fields, could you make these 'projects' Epics (or create another Work Item type) under a 'global project'? If so you can easily customise work items to include these fields.

VSTS Chart Query by Parent/Feature

I'm looking to create a nice dashboard in VSTS with a set of relevant charts for my collegues so they can keep track of things.
We have a project for keeping track of it operations tasks. In this project we've created different Features for different departments of the company.
Is there a way to filter the user stories by parent/feature so that I can make different charts for different departments? I've managed to create a "Work items and direct links" query that actually only outputs the User stories in one feature, but such queries can not be used in charts unfortunately.
Other workarounds would be acceptable too.
There is a Work Item Visualization extension that you can check whether it meets your requirement (Can highlight specified work items).
Another way is that you can custom a dashboard widget or other extension to display the result: Add a dashboard widget.
There are many extension samples that may benefit you: vsts-extension-samples