4

I'm using SharePoint 2013 and I have created a calendar (based on the Standard calendar list template). After that I switched on Content Approval for this calender in the versioning Settings. After that I added a workflow (based on the Standard SharePoint 2010 Approval Workflow and selected 'Update the approval status after the workflow is completed (use this workflow to control content approval).' The workflow is also set to automatically start when a new item is created.

Now I added a new item to the list. An email is sent and a new workflow Task is created. I opened the newly created Task and click on 'Approve'. After that another email is sent and the workflow Task is set to finished. The workflow history of the item Shows that it has been approved.

But when I open the item the approval status shown here is still on 'Pending'.

In other words: although I created a workflow and activated Content approval. Although the workflow Task is finished (approved) the Content Approval state of the item is not updated - stay on 'pending'.

I can't find an error in the logs.

4 Answers 4

3

Make sure you have the site feature "Workflows can use app permissions" activated. Without it you will not be able to change the status of content approval. With it enabled your initial workflow will work like a charm.

6
  • Can I assume that none of the above applies to a SharePoint 2013 workflow as I don't have a Set Content Approval Status Action Commented Nov 5, 2014 at 17:37
  • "Set content approval status" do surely exist in SP 2013 Workflows @westerdaled :) Commented Jan 27, 2016 at 12:01
  • @RobertLindgren, no, that action does not exist in 2013 worfklows: msdn.microsoft.com/en-us/library/jj728659.aspx Commented Apr 25, 2016 at 15:32
  • Strange, pretty sure I have used it in a 2013 workflow (at the same time a wrote the comment above) Commented Apr 25, 2016 at 15:35
  • Like this: <local:SetModerationStatus Comments="{x:Null}" ItemId="{x:Null}" ModerationStatus="Approved">, is that not 2013 WF code? @ChrisPEditor Commented Apr 26, 2016 at 6:08
1

I observed the same behaviour on SharePoint 2013 and did the following:

e.g. change

If Workflow Context:Association: Start on Item Change equals No
    if Workflow Context:Association: Start to Approve Major Version equals Yes
    or Parameter: Enable Content Approval equals Yes
        Set content approval of item that the task process is running on to Pending (run as the workflow author)

to

If Workflow Context:Association: Start on Item Change equals No
    Set content approval status to _Pending_ with _Content approval is pending_

The modified workflow doesn't consider the association properties, thus always writes the content approval status (_ModerationStatus). This works for me...

1

Late to the party I know...but I had a similar issue to this where when my workflow would hit a different stage the approval status would switch back to pending. Because I like the built in approval functionality of a list I didn't want to give that up to roll my own approval workflow, instead I wanted to keep using that built in approval but there were certain stages of my workflow where the item must have been approved to reach, however it would confuse the users to see pending in the column after they have already approved the item. Additionally I wanted my users to continue to see the stage the workflow was in. So what i did was a little hacky, however it seems to do the trick.

  1. Enable the site feature "Workflows can use app permissions"
  2. Open SPD'13 to your site, if you had it open already you may need to restart the app in order for it to detect this change to your site.
  3. Add an App Step and then set the content approval status in the current item to Approved. Essentially this will "fix" the status of approval.

There will still be a brief moment where by the status shows as pending, however once the wf hits that app step it sets it back to the appropriate status. This was a great source of frustration for me so I hope this will help someone else down the road.

So it would look something like this in SPD'13: App Step

3
  • This seems impossible to me. "App Step" is only a feature of SharePoint 2013 Workflows, but "Set Content Approval Status" only appears in SharePoint 2010 Workflows. :( I hope I am just missing something, because I really need to get this working! :)
    – Shayne
    Commented May 30, 2015 at 19:13
  • @Shayne I'll double check that when I go back to work, but I'm sure I took that snip right off my designer UI.
    – Lazy Coder
    Commented May 31, 2015 at 20:19
  • 2
    Boy.. I sure do hope so! I have been trying to figure out how to do a "proper" Document Set Approval Workflow for almost a FULL week now! That is my biggest complain with SharePoint. After 4-5 years of development experience, I still run into "silly" problems like this (regularly!) that take days and days to solve!
    – Shayne
    Commented Jun 1, 2015 at 23:27
0

Please do not check "Change item starts workflow" checkbox, and it Approves!

enter image description here I also activated "Workflows can use app permissions", but don't think it is necessary.

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