In Azure DevOps portal how to query list of tasks whose Completed effort is modified today - azure-devops

In Azure DevOps portal how to query list of work items whose "Completed effort" is modified today. Actually I'm trying to query list of work items my team members have worked today and email them to my manager.
I'm able to query list of work items "modified" by users today, but I do not want to retrieve a work item if it's completed effort is not modified and some other filed is modified.

I am afraid it cannot be done directly. There is not such a filter of completed effort change.
However, there is a workaround to achieve this. Check below:
1, Add a custom field of Date type(see below Modified Date field). Check here for detailed steps.
2, Create a rule: Check here for detailed steps:
Condtions: When change was made to Completed work field.
Action: Set the customized Modified Date field to the Changed Date
3,Then you can add Modified Date filter in your Query. See below query, only the work items whose completed effort filed is modified today will be returned:
Another workaround is to use work item tracking Rest api. This is a little complicated:
1, First call Wiql rest api to get all the work items of your current query.
2, Second loop through the returned work items and call Updates rest api, Then filter those work items whose completed effort field has new value.

Related

Is it possible to query when a specific field changed in Azure DevOps?

I have a DateTime field (MyDTField) in my Azure DevOps instance (I am an admin on it, so I can change its schema if necessary). I would like to write a query that returns any items where the above field (MyDTField) changed in the last 7 days. Is this possible to do?
For e.g. the built in "Changed Date" field allows us to write a similar query, but that returns work times where any field value changed. I want to get items where a specific field changed within a specified time period.
Thanks!
You can try to set up a query like as below to see if it can work as expected.
To view more details, you can see:
Query history and discussion fields
Operators and macros supported for each data type
[UPDATE]
As a workaround, you can try like as below on each of the work item types that have the MyDTField field:
Add another custom Date/Time field, for example "MyDTField Latest change Date" field.
Add a work item rule like this. With this rule, once the MyDTField field changed, the value of the MyDTField Latest change Date field will be automatically changed to the current date/time.
Set up the query like as this. With this query, you will get the list of work items as your expectation.

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.

OData Query to Only Return State Changes from Azure Devops

I have an OData Query that I am using to pull data into PowerBI that I am trying to make more efficient. I am doing a report from Azure DevOps and pulling data in from the WorkItemRevisions resource. Currently, I am pulling all the data for a Work Item and then filtering in PowerBI to only get when the State has changed. I would like to move this filtering to the Odata query so that I can minimize the data that I am pulling into the report.
Currently, I have a query like the following (simplified example used for this question)
https://analytics.dev.azure.com/{Organization}/{Project}/_odata/v3.0-preview/WorkItemRevisions?
$select=Revision,WorkItemId,WorkItemType,Title,State,ChangedDate,LeadTimeDays,ParentWorkItemId
How can this be updated so that only Revisions where the State has changed (from New to Active, Active to Done, etc) are returned?
How can this be updated so that only Revisions where the State has changed (from New to Active, Active to Done, etc) are returned?
I am afraid that OData Query could not perfectly achieve what we need.
There is a feature Revisions/any(r:r/state eq '{state}') to filter the work item has a set state in the past.
For example:
https://analytics.dev.azure.com/<Organization>/<Project>/_odata/v2.0//WorkItems?
$filter=State eq 'Closed' and Revisions/any(r:r/State eq 'Active')
This query is similar to a Work Item query that uses the Was Ever operator.
As I said, this may not be a perfect solution. That because it can only filter whether the work item has ever had a specified states, but cannot accurately determine the states of the work item must be from New to Active, Active to Done. If we change the state of the workitem from Active to Resolved, then change it from Resolved to Closed. Then this work item will appear in the query results.
In addition, even if you use the UI query, we cannot accurately query the result of the work item status changing from A to B. To achieve this goal, we need to use REST API.
So, we could use the feature Revisions/any(r:r/state eq '{state}') to reduce the data pulled into the report to a certain extent.
You can use below query to achieve what you want.
/_odata/v4.0-preview/WorkItemRevisions?&$apply=filter(((WorkItem/WorkItemType
eq 'Bug' or WorkItem/WorkItemType eq 'Product Backlog Item') and
((WorkItem/ChangedDate ge 2022-10-05Z and WorkItem/ChangedDate le
2022-11-04Z) or (WorkItem/CreatedDate ge 2022-10-05Z and
WorkItem/CreatedDate le 2022-11-04Z))))/groupby((WorkItemId,State),
aggregate(ChangedDate with min as MinChangedDate))
To filter the group by data you need to encapsulate it under $apply as it is shown above.
Above URL will return all states and their changed dates for Bug and PBI Work Item types which are added or updated with a given date range.
Hope it helps!
if you are able to use Analytics Views instead of OData, there is a dedicated field available in Analytics Views Fields setting called "State Changed Date"

How do I set up a query in Azure DevOps to tell me which items I have transferred out of my area path today?

Right now I have the following query:
screenshot of query in DevOps
It's returning items I've transferred today, as I intended, but it's also returning items that were changed today by other teams (e.g., I transferred something out on Friday, but the other team changed it today, so it shows up).
Since there is no "Transfer Date", only "Changed Date" or "State Change Date", is there a better way to set this up?
How do I set up a query in Azure DevOps to tell me which items I have transferred out of my area path today?
That because you have set the Operator to Was Ever, which will return the work items that you have ever changed.
So, if anyone change it today, it will show up in your query result.
To resolve this issue, you need to change the Operator to =:
Now, it will not return the workitem you transferred out on Friday.
Update:
the results do not stay in the query since "Changed By =" only shows
the LAST person to make a change. So for example, I transfer the item,
then someone from another team immediately comments. That work item no
longer shows up in the query, but I want to track it until the end of
the day, so I can know "x items total have been transferred out
today".
Indeed, this is a issue. It seems there is no such out of box way to resolve this issue at this moment.
As workaround, you could add custom field in our custom process, then add a Rules to set the value of the custom field to True when area path is modified.
Just like the similar thread.
Now, we could add custom field as new clause in the query, so that we could filter out the wokitems you want. However, the limitation of this method is that it can only work on newly created wokitems, and has no effect on those previously created workitems.
Hope this helps.

Update sales order items using a workflow in NetSuite

I'm starting to get the hang of NetSuite but this one has stumped me. I am looking for a way to update the line items on an order from a workflow in NetSuite. From what I can tell it doesn't seem to expose those fields, is there any way around this?
I have a saved search returning all of the transaction line items that I want modified, there is a field on the Sales Order Line Item called "Create Fulfillment Order". It shows up under saved searches as "Create Fulfillment Order Column", but when I add an action to a workflow to set the field value, the only fields that show up are Sales Order fields. Is there any way to access the Sales Order Column fields, since that's really what's being returned by my saved search anyways.
I've looked at the Sub Types defined in the workflow to see if there's one for Sales Order Item or anything but there's not, just Sales Order. Any help would be greatly appreciated, thanks in advance!
There's nothing built-in that will let you access transaction line items from a workflow. You'll need to use SuiteScript to create a custom workflow action. Then you can call that action from your workflow.