Confluence has been updated to version 6.15.9

JIRA ON-PREMISE

Introduction

In some cases, your counterparty would like to see who changed the content of a custom field.  The following snippets show:

  • how to access the JIRA authentication context which contains that specific information. 
  • Store it in a Custom Keys.
  • Extract it from the custom key on the other side, and add the information as a comment.

Source side

Outgoing sync

// Get the message to be sent to the customer from a custom field
replica.customKeys.messageForCustomer = issue.customFields."External Message".value

// get the current logged-in user and store it in a customKey 
replica.customKeys.currentUser = com.atlassian.jira.component.ComponentAccessor
										.getJiraAuthenticationContext()
										.getUser()?
										.displayName


Both messageForCustomer and currentUser can be null because dataFilter is also called (in certain cases) asynchronously to provide responses.

Destination side

Incoming sync

Use the customKey: if the messageForCutomer is provided, add a comment prefixed with the full name of the currentUser.  Use 'development' if no user is provided.

if (replica.customKeys.messageForCustomer != null) {
   String author = replica.customKeys.currentUser ?: "development"
   String messageBody = author + " : \n" + replica.customKeys.messageForCustomer
   issue.comments = commentHelper.addComment(messageBody, issue.comments)
}


Back to Advanced configuration in Exalate for Jira on-premise