-
Bug
-
Resolution: Handled by Support
-
Medium
-
None
-
3.12.3
-
3.12
-
This bug is similar to bug JRA-13523.
The issue is the user created a custom multi-user picker field. When this field is called an error is thrown.
In JRA-13523 there is a custom multipicker field used. When assign all users is selected an error is thrown:
java.lang.IllegalArgumentException: Value: must be a collection. Type not allowed: class java.lang.String at com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType.getDefaultValue(AbstractMultiCFType.java:80) at com.atlassian.jira.issue.fields.CustomFieldImpl.populateDefaults(CustomFieldImpl.java:463)
In this case it is the same error but instead of ASSIGNING all users from the custom multi-picker field in this case it is NOTIFY all users.
This was fixed in 3.12. I am thinking that a similar fix for JRA-13523 would also fix this problem. The fix was:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The MultiUserCFType needs to override the getValueFromIssue(CustomField field, Issue issue) method to return a Set rather than a List.
Or, we could make the UserCF a little more robust and make the following method able to handle more than just a Set:
public Set getUsers(PermissionContext ctx, String customFieldId) { if (ctx.getIssue() == null) { throw new IllegalArgumentException("PermissionContext has no issue"); } Issue issue = ctx.getIssue(); FieldManager fieldManager = ComponentManager.getInstance().getFieldManager(); CustomField field = fieldManager.getCustomField(customFieldId); CustomFieldType type = field.getCustomFieldType(); Object obj = type.getValueFromIssue(field, issue); Set users = new HashSet(1); if (obj != null) { if (obj instanceof Set) { users = (Set) obj; } else { users.add(obj); } } return users; }
---------------------------------------------------------------------------------------------------------------------------------
To reproduce using the customers backup:
- Create issue
- Go into the TIA ITR's project
- Issue Type IT Request
The error is thrown.
- relates to
-
JRASERVER-13523 Multi user custom field cannot be used with the assignable user permission
- Closed