Need Topicbody content from Sitecore JSON through Groovy
Dear All,
I have Sitecore JSON where topicbody is there and I want to get all values from topicbody
So I have written below groovy code
***************** MY GROOVY CODE *******************
def testMapList = [:]
testMapList[tabContent.itemId] = tabContent.title + "==" + tabContent.pocId + "=="+ tabContent
//testMapList[tabContent.itemId + "_metadata"] = tabContent
testMapList.each { key, value ->
def testTitle
def testPocId
def testMetadata
/* if( key.contains("_metadata")){
testMetadata = testMapList.get(key + "_metadata")
LOG.debug("testMetadata Value ==== ${testMetadata}")
} */
if (value.contains("==")){
testTitle = value.split("\\==")[0]
testPocId = value.split("\\==")[1]
testMetadata = value.split("\\==")[2]
LOG.debug("testMetadata Value ==== ${testMetadata}")
LOG.debug("testMetadata assignededitor Value ==== ${testMetadata.assignedEditor}") // here I am getting NULL
}
}
The issue is here that when I am trying to get the value of topicbody by using above command LOG.debug("testMetadata assignededitor Value ==== ${testMetadata.assignedEditor}") // here I am getting NULL , then I am getting NULL value.
Here topicbody values are coming fine like below
testMetadata Value ==== [__typename:KmAlgorithm, assignedEditor:mfad\M066721, assignedTo:mfad\MJS16, workflowItemManager:mfad\BRR04]
Thanks
Sonu