Versions Compared

Key

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

...

  1. mapList: A list of all Result Maps that should have issue association resolved based on the Message ID.

  2. onIssueIDField: The ID of the custom field the Message ID of the email will be stored on the issue.

Script

Code Block
// Creates a list of Result maps which use the '_jemh_recipient' key to specify the recipient used to generate the ResultMap
var resultSetList = jemhUtils.createResultSetForAdditionalMailboxAddresses();

// Gets the 'initial' catch email address, which initially matched to create the 'original' ResultMap
var caughtRecipient = jemhUtils.getCatchEmailAddress().getAddress();

// Sets the Result Map's '_jemh_recipient' to the actual caught Email address
resultMap.put("_jemh_recipient", caughtRecipient);

//adds Adds the resultMap to the List of additional resultMaps. This is done to make iterating through each resultMap for issue association easier
resultSetList.add(resultMap);

//finds Finds the Project key associated to each resultMap based on the  '_jemh_recipient' key. If No project is found, the ProjectMapping default will be used
jemhMapperUtils.findProjectKeyForResultMaps(resultSetList);

// Sets the customField Id used for Issue Association. The Issue keys for each resultMap are resolved based on the Message ID. To summarize the method, a hash of the Message ID of the email is used to establish if any other issues
// in the project have the same hash in the custom field specified by the the 'externalIdField'. Any Issues found via a bounded JQL query (max 10) are sorted by creation date (Ascending). As this is a 'Filtered' method variant, any 
// thread match conditions defined in the profile are run against the viable issues. removing any issues which do not meet this criteria. Finally a single (created first and valid) issue is selected, and the issueKey is added to
// the Result Map.
var
externalIdField = "customfield_10122";
jemhThreadUtils.resolveFilteredIssueAssociationByMessageIdForAdditionalResultMaps(resultSetList, externalIdField"customfield_10122");

// Based on the defined project in the result map, and the '_jemh_recipient', any valid Domain Rule configurations and project mapping values are applied to the result set, as if the email had been mapped to a specific project.
jemhMapperUtils.applyProjectMappingDomainRulesToResultMaps(resultSetList);

...