I am trying to below code to create tasks in confluence, but it is communicating with Jira, please suggest code snippets for confluence
import com.comalatech.workflow.TaskService
import com.atlassian.confluence.pages.DefaultPageManager
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType
try
{
@WithPlugin("com.comalatech.workflow")
def appLinkService = ComponentLocator.getComponent(ApplicationLinkService)
def appLink = appLinkService.getPrimaryApplicationLink(ConfluenceApplicationType)
// def event = event as ApprovalAssignedEvent
//def taskService = ComponentLocator.getComponent(TaskService)
def pgMgr = ComponentLocator.getComponent(DefaultPageManager) // this is not getting handle on the instance
def pg = pgMgr.getPage(5567820)
def taskService = ComponentLocator.getComponent(TaskService)
taskService.createTask(pg,"Review task for reviewer 2","admin","Do what you need to do")
}
catch(Exception ex)
{
}