Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

(warning) requires sender/reporter user to have MANAGE_WATCHERS permission!

This Field Processor Script work on create only (uses relatedIssue and requires ccAddresses to be non null):

Script:

if (relatedIssue === null && ccAddresses!==null && ccAddresses.length>0) {
  var watcherCsvUsernames='';
  
  for(var i = 0; i < ccAddresses.length; i++) {    
    var jiraUser = jemhUtils.getUserByEmail(ccAddresses[i].getAddress());
    if (jiraUser !==null) {
      print('found cc jira user: '+jiraUser.getUsername());
      if (watcherCsvUsernames.length>0) {
        watcherCsvUsernames+=",";
      }
      watcherCsvUsernames+=jiraUser.getUsername();
    }
  }  
  resultMap.put("watchers", watcherCsvUsernames);
} else {
  print('no cc recipients');
}

Screenshot:

image-20241113-124224.png

  • No labels