How can I create a custom rule when changing board column in Azure Devops Boards? - azure-devops

I am trying to create a custom rule so that a custom field must be defined when moving a card to a specific board column but can't find how to do it.
Something in the lines of:
When board column changes value to "Deploy" make custom field "Target" required.
A user should not be able to move a card to column "Deploy" whithout field "Target" being defined.
Any suggestions?
There is a similar question but the only answer to that is using state changes isn't applicable for this particular column change.

The Board Column are not fields of work items as Shamrai mentioned. I am afraid it cannot be done by using the column Name.
The workaround is to map the columns to different states. And then add custom rule by using the workitem state changes.
Click the Gear icon on the Boards page, Navigate to Columns. See below:
You can add Custom State for User Story,Feature and Epic, if there are not enough states to map with the columns.
Go to Organization Settings--> Process under Boards-->Select the inherited process the your project using-->Click User Story(or Feature and Epic)-->Navigate to State and Add new State.
Now you can create the custom rule to make the Target field required when the state of the work item is changed (moved to a different column).

That`s a problem because Board Column, Board Lane, and Board Column Done fields are not available in the fields list to assign rules. I think you may try the following:
Add custom state "Deploy" and assign it to your column. Then use rules.
Create a custom application that queries Deploy without Target and returns such work items with comments "where is your target?" How can I find all work items in a given board column via Azure DevOps API? , How to update the work item from Powershell For VSTS?

Related

Azure DevOps Bulk Updating a Custom Field

All,
I have a custom field that was added to TFS Azure DevOps and now I need to update any Feature or Story that have a certain text in that field.
Example:
Custom field: PGM0001234
(present both on Features and Stories)
Change to: PROG0004567
Is there a way to do that either on the backend or VisualStudio? There are thousands of work items that need updating so it's not like it's less than 100 feature/stories.
Yes. Create a new Query from ../_queries and set the Field to your custom field.
Run the query, and the results will contain all items where your custom field contains the value PGM0001234.
In the results set, select all and then click the ... after one of the items and choose Edit from the menu.
In the Edit work items dialog, select your custom field and assign new value in the Value field. Click OK and you'll be taken back to the query results with everything in bold. Press 'Save Items` and TFS will then apply the change.
TFS may complain that some fields contain invalid fields, such as Assigned To is a user who has left the business. You may need to bulk-reassign those items to another user in the Edit work items dialog.
Another option is to use Excel. Create a query like the one mentioned above, then open that query in the Excel plugin for Azure DevOps. Do a search and replace or other bulk edit in excel and then het the publish changes button.
Excel is a really convenient way to bulk edit work items.

Inactive Tasks Query in Azure Devops

We are currently implementing Azure Devops for our backlog and task management. We are using a Kanban board setup. I would like to add a query to our dashboard to show Stale actions, effectively I want to see a list tasks that have been assigned but not modified in 7 days.
Initially I tried the state change date, but am finding that some tasks are having activity but just not a state change.
So I tried Changed Date, but that shows changes to the priority level when other items are changed.
How can I write a query that would only identify work items that have not been modified in over 7 days?
Currently there are no existing field can meet your requirement. And the Changed Date field will be updated if there are any changes to this work item as you mentioned.
As a workaround, you could try following steps.
Add a custom field to a work item type (Inheritance process), I add field LastEdit which is Date/Time type and IsActive which is Text (single line) type for Task, and field IsActive is required, as below.
Add a rule to a work item type (Inheritance process), I add 3 rules for Task, as below.
Therefore, the field LastEdit is the last edit time, and users must edit the field IsActive when they update this work item and then the field LastEdit will be updated, otherwise they cannot save their changes.
Now you could filter target Tasks that using the field LastEdit, as below.
Here's the approach I tried utilizing rules to set a "LastEdit" custom date field. I have 4 of these set for different changes, then I can query off the LastEdit date. It'll take a few days before I know if this works or not, but some simple testing seem ok. The major shortcoming I see is that I cant create a rule to update the LastEdit based on a new comment being entered.

How to bring custom fields created under inherited process in Azure DevOps Queries

I created a inherited process under inherited Scrum process (like 'X-Scrum') and added new fields like the below,
X.Original Estimate (Decimal)
X.Completed work (Decimal)
X.Remaining work (Decimal)
This is successfully done and reflected in the task screen.
Issue/ Help required:
I'm not able to bring those three fields into QUERIES, as I would like to extract all product backlog item, tasks and related custom fields.
Can someone help me on how to bring the custom fields into the queries.
Some special characters are prohibited for the Definition name of the custom field. If you add a new field with one of them(eg. .,()), you will get below error.
However you can change the Label of the field in the Layout section, which will be displayed in the task screen
In the QUERIES, only the Definition Name is showing up in the fields
So I guess you just changed the Layout Label of the custom field as X.Original Estimate (Decimal). But the Definition Name of the custom field is not X.Original Estimate (Decimal). Yon need to check what is Name for the field in Definition section. The Queries will reflect this Name.

How to add a message in Azure DevOps work item template, "Select a value to field 'XYZ'", without marking that field a mandatory?

How can we notify a user to select a value to a drop-down field in Azure DevOps work item without making it a required field.
The reason of not making it mandatory is because it is not a compulsory information.
But the reason for this 'way to notify' is to make sure that this value is to be filled when it is relevant (which is most of the time - but not all the time).
There is no option to add a notification on a field without making it mandatory, but there is a workaround to force the user to think about the value of the field.
You can add an additional boolean field who is enabled by default. This field can be used to create a rule for your original field, to indicate if it is required or not.
So to set this up you have to add the following fields/rules to your work item type:
2 fields:
originalFieldName (the field with extra attention)
booleanFieldName (Boolean, default value: true)
2 Rules:
When a work item is created
Then set the value of booleanFieldName to 1
When the value of booleanFieldName Equals 1
Then make originalFieldName required
With this solution the user always have to fill in the field or make the field is optional by deselecting the boolean field.
If you just want a message to be displayed in the work item to notify user to select a value. There is a workaround that you can create a customized process. You can customize the fields and pages in the your custom process.
For testing, i create a custom process and add a notification text to a group name to indicate use to select a value for a field. Please refer to below step.
1, Go to the Process section in the Organization Settings, and select the process that you want your custom process inherit from.
2, Then choose the work item type you want to edit. You can edit or add a fields or group to the work item type. For below example, i edit the title for Planning group to add a notification message.
For more information about custom process please refer the official documents.
If you already choose a process to your project. You can refer the detailed steps here to change your project process to the customized process.
Hope you find above helpful.

create github like "label" feature

I have noticed on github they allow you to create multiple labels and associate that with an issue, if you want to filter you can filter by label.
How would I go about creating something like this?
I have a task manager, what would I need to store in the database for the labels?
My process (thinkin out aloud): Create a task, allow user who created the task to add a label, this label has to be from a predifined list, so a table called UserLabels - where I can store the labels, I will show the labels from this list when a user wants to add multiple labels to their task.
Do I store the the label ids inside a nvarchar(max) field as an array i.e:
{labelid:5,labelid:6,labelid:900}
What is the best way to do this?
If you're wanting to do this the propper way you'd have a table that maps task ID's to Label ID's. as foreign keys.
This would be the correctly normalised way to do it.
Personally I'd have a field in my task table that contained either a list of label ids or the labels themselves. It would depend on my criteria really.