How to get sprint wise automated test cases in Azure devops system? - azure-devops

I am in need of getting some automation metrics like, what are the test cases automated in a specific time period in ADS. I tried the below query.
The challenge with this query is: it is retrieving the automated test cases which were automated before this duration. It is because their other attributes are changed like: Title, some tags etc. I was looking for some field that stores the information like(Automated Test Id, Automated Test Name, Automated Test Storage, Automation status). But I didnt' see this. I tried to use "History" field, but that didn't work as it is not populated the automation information in history field.
Any thoughts please?
enter image description here

How to get sprint wise automated test cases in Azure devops system?
At this moment, we could not query the History with State changed from one state to another state on Web UI directly.
As workaround, we could add a custom field in our custom process that gets set the value to true when workitems state change from X to Y.
Then add a Rules to set the value of the custom field to True if the workitems state change from X to Y.
Finally, we could query the workitems with custom field status.
You could check this thread for some more details.
Besides, you can also try do it through PowerBI. Calculate time-in-state for an existing Analytics view.

Related

Prevent users from creating new work items in Azure DevOps

I've been looking at organisation and project settings but I can't see a setting that would prevent users from creating work items in an Azure DevOps project.
I have a number of users who refuse to follow the guidelines we set out for our projects so I'd like to inconvenience them and the wider project team so that they find it better to follow the guidelines than not - at the moment we've got one-word user stories and/or tasks with estimates of 60-70 hours which isn't reflective of the way that we should be planning.
I'd still want them to be able to edit the stories or tasks and moving statuses, but that initial creation should be off-limits for them (for a time at least). Is there a way to do this??
The Azure DevOps Aggregator project allows you to write simple scripts that get triggered when a work item is created or updated. It uses a service hook to trigger when such an event occurs and abstracts most of the API specific stuff away, providing you with an instance of the work item to directly interact with.
You can't block the creation or update from, such a policy, Azure DevOps will inform the aggregator too late in the creation process to do so, but you can revert changes, close the work item etc. There are also a few utility functions to send email.
You need to install the aggregator somewhere, it can be hosted in Azure Functions and we provide a docker container you can spin up anywhere you want. Then link it to Azure DevOps using a PAT token with sufficient permissions and write your first policy.
A few sample rules can be found in the aggregator docs.
store.DeleteWorkItem(self);
should put the work item in the Recycle Bin in Azure DevOps. You can create a code snippet around it that checks the creator of the work item (self.CreatedBy.Id) against a list of known bad identities.
Be mindful that when Azure DevOps creates a new work item the Created and Updated event may fire in rapid succession (this is caused by the mechanism that sets the backlog order on work items), so you may need to find a way to detect what metadata tells you a work item should be deleted. I generally check for a low Revision number (like, < 5) and the last few revisions didn't change any field other than Backlog Priority.
I'd still want them to be able to edit the stories or tasks and moving statuses, but that initial creation should be off-limits for them (for a time at least). Is there a way to do this??
I am afraid there is no such out of setting to do this.
That because the current permission settings for the workitem have not yet been subdivided to apply to the current scenario.
There is a setting about this is that:
Project Settings->Team configuration->Area->Security:
Set this value to Deny, it will prevent users from creating new work items. But it also prevent users from modify the workitem.
For your request, you could add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions.

Is there a way to see runs associated with a specific test plan in Azure Dev Ops test?

This may really be more a QA question. I'm sort of hamstrung in my organization, I don't have API access for some of the Azure REST calls. I've got a number of test plans with various suites, and reporting the overall current status in terms of passed, failed, etc. is straightforward.
What I'm not able to do easily is get a historical view of all the runs of a given test case. So I can't seem to easily get a metric that says (as an example) we had to run this test case 12 times before we got a pass. Most of the help I'm seeing online references some great ways to get all test IDs if you have API access, I'm not sure if there's another way outside of it.
There is New Test Plans Page in azure devops Previous Features, which allows you to view the historical test result of a test case.
First you need go to "User setting-->Previous Features of your azure devops and Turn on New Test Plans Page
Then Go to your Test plan-->Go to Execute page-->Click 3dot-->Choose View execution History
Then you will see the historical test results in a new page. You can also filter the execution
history as below highlighted

Feature State Updating Automatically

Feature cycle time is a very important metric, but in ADO there doesn't seem to be a way to get the State of a Feature to automatically update when the first story moves into Active (or the last child is closed). Does anyone know of a way to have this happen?
No, that will never happen. This area for custom application and solutions. You can try the following:
TFS Aggregator
Write your own solution through rest api: Automation of state changing for Azure DevOps work items based on states of child work items
Use additional solutions: Automation of state changing with Azure Logic App

Reset Id from task Azure Devops in Boards

As the image shows, for each task that is created in my backlog, devops generates an Id for each task. In my implantation studies, the Id grew and now that I'm going to implant it, I would need it to start from 1 and not based on my last one. How do I do a reset?
I would need it to start from 1 and not based on my last one. How do I
do a reset?
Sorry but we can't reset WIT ID. There's no option in Azure Devops supports the reset of Work Item ID.
Please check this: Each work item is based on a work item type and is assigned an identifier which is unique within an organization(Service) or project collection(Server).
Azure Devops Service doesn't re-use unique identifier, because that makes nasty problems to troubleshoot. So the ID won't be reset even after we delete all the work Items and Projects in Organization.
Just as DevOpsy suggests, you should create one new organization for your final usage. And then the WIT ID will start at 1.
Similar discussions about WIT ID number see here and here. Hope it helps to resolve your puzzle and provides correct direction :)

How to query a Work Item's state changes from Azure DevOps in Power bi

I want to track the changes of all Bug Work Item's states from Azure DevOps in Power Bi as close to live as possible. How do I get Power Bi to identify a work item which has had it's state changed recently?
In the needs simplest form, I'd like to see the state graph (shown in history view of each work item on Azure DevOps) and then add an additional rule which identifies work items that have gone through certain changes as soon as they happen/as soon as I look which will be every hour or so.
so far attempted using analytics views to identify and upload to Power Bi but the "changed date" field applies to all changes not just state changes.
Tried using azure devops queries but they don't identify previous state values.
so far attempted using analytics views to identify and upload to Power Bi but the "changed date" field applies to all changes not just state
changes.
For this issue, you can add State Change Date field
as soon as I look which will be every hour or so.
For this issue,I am afraid it is currently impossible to achieve. The highest granularity possible in Analytics View of Azure Devops is Daily but for a single work item it captures on one state for single day. If there are multiple state changes in a day we loose that data and only get the latest update state row. So, currently the analytics view only shows the latest status within a day.
Here is a case to explore analytics view results incomplete,please refer to Issue#2 of it.