I had same issue. I am using CQ 5.5.
Sharing my experience, hope it will work for you.
You don't need to change the payload. The payload can remain as jcr:content
You need to do two things:
Make sure the folder-path/jcr:content has the value in property jcr:title. It will be shown in content column of the inbox page.
For the folder link in inbox page, it must be as /content//jcr:content. The problem is because /damadmin.html# is not added before the url.
This problem is not coming for any Asset or Page.
Solution is:
You need add the following code in /libs/cq/workflow/components/inbox/list/json.jsp
A=>
Add private method
private String handleDamPathForFolder(Logger log, String payloadUrl, Session session, WorkItem wi)
{
try
{
if(isFolderNode(session, wi))
{
return ("/damadmin.html#"+payloadUrl);
}
}catch (Exception e)
{
log.error("Unable to handle path creation for work item: " + wi.getId(), e);
}
return payloadUrl;
}
You have to write the method isFolderNode which will return true if the node is a folder.
B=>Replace
JSONWriterUtil.write(writer, "payload", pathBuilder.getPath(wi),JSONWriterUtil.WriteMode.BOTH, xss);
by the follwoing
JSONWriterUtil.write(writer,"payload",handleDamPathForFolder(log,pathBuilder.getPath(wi), session, wi), JSONWriterUtil.WriteMode.BOTH, xss);
Enjoy!!!
PS: Modify method arguments as per your code.