I'm trying to get the SPWorkflowStatus for a SharePoint 2013 workflow. I was just trying something simple like getting the workflows for a specific SPListItem and trying to access the SPWorkflowStatus. In the process I also noticed that I'm only seeing SPWorkflowAssociation values for the list when they are SharePoint 2010 workflows. I'm not seeing SPWorkflowAssociation entries for the list when it is a SharePoint 2013 workflow. I can only figure that I'm missing something specific to SP2013 workflows. Any insight is appreciated.
1 Answers
0
votes
Are you using PowerShell to get list association workflow and item workflow?
I can get the association workflow for list using the code below
$wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$sub = $wfm.GetWorkflowSubscriptionService()
$subscriptions = $sub.EnumerateSubscriptionsByList($list.ID)
$siteURL = "URL"
$web = Get-SPWeb $siteURL
$list = $web.lists[$listname]
$items = $list.GetItems()
$items[0][$workflowname]