Confluence has been updated to version 6.15.9

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article describes how to write a script rule in Exalate visual mode.


Intro

Script rules can be used when the standard mapping rules are not sufficient to cover the use case.
Creating a script rule is straightforward.


  • Edit your visual connection
  • Select the rules
  • Select the 'add script'


Image Added



How does it work


The scripts are groovy based - meaning that all groovy structures can be used to define the behaviour of the mapping.


For instance  - if a mapping is needed between the assignees of side with instance name 'left', and side with instance name 'right'.
Following code snippet will implement the mapping

Snippet
// define the mapping

def leftToRightAssignee = [
    // left Assignee ---> right Assignee
    "peter@acme.com" : "peter.pan@acme.com",
    "cinderella@acme.com" : "cinderalla.white@acme.com",
]


// look up the corresponding email, default to team@acme.com
def targetUserEmail = leftToRightAssignee[left.issue.assignee?.email] ?: "team@acme.com"

// assign to right issue

right.issue.assignee = nodeHelper.getUserByEmail(targetUserEmail)



Examples

Below you can find examples of the most common field types that are usually synchronized

...