1

How can I find out which items in my list are running the old version of the workflow?

enter image description here

2 Answers 2

2

You can do this via Powershell. Since the previous workflow versions get a different name on replacement, you could check against the name (you could also check against the creation date, of course).

For example

$listName = "ABC"
$workflowName = "ABC-WF"
$site = Get-SPSite("http://myspsite")
$web = $site.OpenWeb()
$list = $web.Lists.TryGetList($listName)
$itemsWithDiffWorkflow = $list.Items | Where-Object { $_.Workflows | Where-Object { $_.ParentAssociation.Name -ne $workflowName -and $_.IsCompleted -eq $false } }
if($itemsWithDiffWorkflow -ne $null)
{
    foreach($item in $itemsWithDiffWorkflow)
    {
        write-host $item.Title
    }
}
$web.Dispose()
$site.Dispose()

This prints out all the item titles of items that have it's workflow not completed and the workflow is not named "ABC" (the newest version). If you have more than one workflow associated with the list, you have to change the script accordingly.

1
  • Thanks, this looks promising but it looks like this won't work for me as I don't have access to the server SharePoint is installed on. It doesn't like Get-SPSite
    – Enilorac
    Jun 28, 2015 at 11:02
0

you can simplify this - you do not really need get-SPSite. You can simply remove that line and change the $web line to the following:

$web = get-spweb "https://mysite/web"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.