3

I need to create a report by Sitecore Powershell Extension where I need to include the details of "Workflow Approver" and "Date on which workflow approved".

I have got the list of referring items for Approved Workflow State. While looping through by foreach loop I need the details of workflow attached to each item by which I want to get the User who approved the workflow and Approved Date.

Below is a partial code for the powershell script :-

Foreach($item in $referringItems) { 

    $itemPaths = $item.Paths.FullPath
    if($item.Paths.FullPath.contains('/sitecore/content/my-website'))
    {
        $rendering = $item | Get-Rendering        
        $addInList = New-Object System.Object
        $addInList | Add-Member -type NoteProperty -name ID -Value $item.ID
        // Here I want to get the last updated aproved workflow details as mentioned above in description by $item.ID.              
        $listofWorkflowItems += $addInList
    }
}
$listofWorkflowItems | Show-ListView

I have searched a lot but could not get any link/powershell command which can guide me to retrieve this information in sitecore powershell extension.

Could anyone provide some guidance on this Whether this is possible or not the way I am thinking to do?

Any help is much appreciated.

4
  • 2
    Does this command help? doc.sitecorepowershell.com/appendix/common/… Oct 30, 2019 at 17:22
  • @MichaelWest Yes this works. I looked into this website but somehow I missed this specific link to get workflow history of an item. Thanks
    – SumitK
    Oct 31, 2019 at 8:27
  • Great. There is also a report which comes out of the box called Stale Workflow Items. This may be a good example to follow. Oct 31, 2019 at 12:41
  • @MichaelWest I need to create a custom report where other information is also required that's why I have tried this way. Workflow details is a part of my custom report. I'll keep in mind of your suggestion for future. Really appreciate your help.
    – SumitK
    Oct 31, 2019 at 13:28

0

Your Answer

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

Browse other questions tagged or ask your own question.