You can now vote for scripts to help people know if they're useful or not. Login or create an account to vote!

1

Create a Task for Each Page Reviewer

Overview

When approvers are assigned to a page, this script automatically creates tasks within Comala Document Management for each reviewer. Edit the script to specify the tasks you wish to assign and set optional due dates.

Example

I have written a proposal and need my team to review it. I would like them to review content, check links, and ensure all diagrams are correct. Instead of creating and assigning these tasks manually, I use the 'Create a Task for Each Reviewer' script to automatically create these three tasks when I add a reviewer.

Good to Know

  • You must have Comala Document Management installed on your Jira instance for this script to work.
  • This is a Custom Event Listener that listens for an ApprovalAssignedEvent.

Additional Information

We've also created a script and blog post to show you how to use ScriptRunner's integration with Comala Document Management to automatically create a Jira issue when a Confluence page is approved.

Requirements

  • Confluence Confluence (6.6 - 6.15)
  • ScriptRunner for Confluence ScriptRunner for Confluence (5.6.14)
    
import com.comalatech.workflow.TaskService import com.comalatech.workflow.event.approval.ApprovalAssignedEvent import com.onresolve.scriptrunner.runner.ScriptRunnerImpl import com.onresolve.scriptrunner.runner.customisers.WithPlugin import java.time.ZonedDateTime @WithPlugin('com.comalatech.workflow') def event = event as ApprovalAssignedEvent // The line below limits this to one space and a workflow state named Review. You can change that to suit your needs if (event.abstractPage.spaceKey == 'MYSPACE' && event.state.name == 'Review') { def taskService = ScriptRunnerImpl.getOsgiService(TaskService) //Get the list of assignees def users = event.assignment.assigneesUserNames users.each { username -> taskService.createTask( event.abstractPage, "Review task for $username", username, 'Do what you need to do', //Task comment Date.from(ZonedDateTime.now().plusDays(7).toInstant()) //Optionally, set a due date for one week hence ) } }
Discovered an issue? Report it here

Suggested for you