How to get the last modified date of a SharePoint list (SPList) - sharepoint-2007

I have some code which replicates list templates files for new sites in SharePoint 2007. It checks the SPList.LastItemModified to see if there are news entries in order to know whether or not to create a new .STP file.
What I would like though to also be able to see if the list was modified, for example the views and columns, etc.
Can anyone help me out with this? Thank you.

It looks like SPList.LastItemModifiedDate is the value that you want.
According to MSDN:
Gets the date and time that an item, field, or property of the list was last modified.
(emphasis mine)
So it is more than just the last item modified, it is the last time the list was modified.
In order to confirm, I looked at a list that, according to All Site Content, was last modified 4 hours ago (the list is updated each night by a timer job). However, the greatest modified date of any list item was 15 hours ago. I then looked at viewlsts.aspx to see how Last Modified is calculated on the All Site Content page and found the following:
SPUtility.TimeDeltaAsString(spList.LastItemModifiedDate, dtCurrent)
So I would use SPList.LastItemModifiedDate to determine the last time the list was modified, but it is not reliable for retrieving the date of the last list item modified.

Related

Find WorkItems that were assigned and finished in the last 30 days

I would like to see a list of workitems assigned to a particular person. I would also like get information about when those workitems were completed. Is there any column like assigned_date and finished_date that i could use?
I saw [Status]='AssignedTo' but didnt find anything that says when it was assigned and when it was finished
This link provides some info that I am looking for but not everything.
You could use the operator “Was Ever” that searches for a value in a field in the history of Work Items. Such a query will return all Work Items you were/someone assigned to, even if now they are assigned to a different person.
However, there is not any assigned_date and finished_date you could use. Several date and identity fields are set based on workflow states or transitions. You could find all
Date and Iteration Path fields here.
You have to use Revisions - List Rest API to return the list of fully hydrated work item revisions and fetch the work item assigned and finished time. Finally check if they are in the last 30 days.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{id}/revisions?api-version=6.1-preview.3

Query how many times target date changed in TFS

We're using TFS for our daily team stand ups which are more task driven vs development iterations. We'd like to be able to track how many times a target date changed & in what areas that's happening the most to see if we can pinpoint bottlnecks. I'm having a heck of a time figuring out a query that will give me these results. I tried querying "History Contains Words changed target date" (based off the image you'll see in the link below) but got no results. When I just say "history contains words date", it only gives me results where someone said the word "date" in a discussion field.
Any ideas?
Screenshot of History Item
It's an expected behavior. Comments entered into the Discussion area are queryable. Change history entries, such as which fields were changed, aren't queryable.
Check the following link for more information:
https://learn.microsoft.com/en-us/vsts/boards/queries/history-and-auditing?view=vsts&tabs=browser

How to get TFS query result but for a previous date

Is it possible to execute a TFS query and get the results not for today but for a previous date?
I just want to see the results that were available in that date.
To clarify: I need to see the state of the work items on a give date to see their evolution over time.
According to your clarification, you need see the state of the work items on a give date. There is not a direct way to achieve it in Work Item Query.
You can only use Was Ever in Work Item Query to list items based on State past assignments, like:
state Was Ever Active
Or you can use State Change Date <= YYYY-MM-DD and State Change Date > YYYY-MM-DD to list all work items that changed State on YYYY-MM-DD. (Need to check whether TFS 2010 has State Change Date field)
Of course you can combine other clauses to narrow down the query.
What you want is actually the work item history. You need to get the work item history programmatically using TFS API. You can check this blog below to use the API:
http://www.codeproject.com/Articles/243653/TFS-SDK-Work-Item-History-Visualizer-using-TFS-API
I think you can create pivot table report to connect to TFS cube. For your requirement to see work items' evolution over time, you can define the pivot table as:
Check these two links for the details: https://msdn.microsoft.com/en-us/library/ms244678 and https://msdn.microsoft.com/en-us/library/ms244710.aspx

How can I get a report of all work items added to an iteration after a given date?

I need to produce a report, similar to the Unplanned Work report included with the MS Agile Process Template, but which lists me all work items which were added to an iteration after a given date.
The work item may have already been created before that date, so I can't used the created date.
Can anyone give any guidance on how I can go about this? If I can achieve it in Excel then that would be perfect...
Thanks.
Ok, took some work. Interesting enough though to put some effort in it ...
First screenshot is a Pivot table connected to the Analysis Cube. The most left colum shows the ID of a workitem. The second column shows the ChangeDate. In the row header I have included every iteration that I am interested in. What you see happening in the Excel sheet is items moving from one sprint to the other. For example, workitem 27 was created for iteration 1 at 14-3-2011. On 13-4-2011 it was moved to iteration 2. On 12-5-2011 it was moved to iteration 3. etc.
If I narrow down the filter to a specific iteration I actually see items entering the iteration and leaving the iteration. If I also change the ChangeDate filter, I can focus on items entering after a specific date, as you requested. Again, you can see item 27 enter iteration 2 at 13-4 and leave at 12-5. You can juggle around with the columns to get the view you want.
Finally, the options I used to get this view from TFS.
Hope this exceeds your expectations :-)

How to handle Append Only text fields in a Sharepoint DataSheet view?

We've created a Sharepoint site to track a process. Eventually we're going to make a workflow out of it, but in the meantime there's a list we all have to look at which lists the various dates each piece is supposed to be finished.
So basically My group needs to see and update columns X, Y, Z and Comments while ignoring the other 30 billion or so columns. Which is great in datasheet view because we can easily view our columns, and update them right there without drilling into the item and browsing through all the other crap we don't need.
The problem is the Comments field, in which we really need to see the last actual comment made. Unfortunately whenever anyone saves the record the field is updated with a blank value (unless they entered a comment) and the last actual comment is lost unless you drill into the item.
Is there some way to get the Datasheet view to show all the entries?
I should also note that I know very little about Sharepoint 2007... so detailed answers would be nice!
Append-only comments are implemented with the version mechanism, so in the Datasheet View you're seeing every row update as a new version of the item with a new comment. In normal data views this logic is handled by the AppendOnlyHistory control. I don't know of any way around this behavior for views that aren't history-aware like the Datasheet.

Resources