You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following example jira configuration will result in no changes in the components array due to the current implementation, regular string fields are correctly replaced
The reason for this is the broken ExecutableJiraAction.merge method, because it does not do the right thing when a list, that is not comprised of a string value is found - which for a map is simple to add.
This unit test resembles the broken behaviour and fails on the last assert
public void testMerge() {
Map<String, Object> writeableMap = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("foo", "bar");
Map<String, Object> componentMap = new HashMap<>();
componentMap.put("name", "value");
List<Map<String, Object>> list = new ArrayList<>();
list.add(componentMap);
map.put("components", list);
Map<String, Object> result = ExecutableJiraAction.merge(writeableMap, map, s -> s.toUpperCase(Locale.ROOT));
assertThat(result, hasEntry("FOO", "BAR"));
assertThat(result.get("COMPONENTS"), instanceOf(List.class));
List<Map<String, Object>> components = (List<Map<String, Object>>) result.get("COMPONENTS");
assertThat(components.get(0), hasEntry("NAME", "VALUE"));
}
The text was updated successfully, but these errors were encountered:
This commit allows JIRA API fields that require a list of key/value
pairs (maps), such as JIRA "components" to use use template snippets
(e.g. {{ctx.payload.foo}}). Prior to this change the templated value
(not the de-referenced value) would be sent via the API and error.
Closes#30068
Original comment by @spinscale:
The following example jira configuration will result in no changes in the
components
array due to the current implementation, regular string fields are correctly replacedThe reason for this is the broken
ExecutableJiraAction.merge
method, because it does not do the right thing when a list, that is not comprised of a string value is found - which for a map is simple to add.This unit test resembles the broken behaviour and fails on the last assert
The text was updated successfully, but these errors were encountered: