New and Improved 3.13 Beta. Highlights: Shareable filters and dashboards and lots of other goodies. Any feedback can be raised as JIRA issues in the JIRA project.
Issue Details (XML | Word | Printable)

Key: JRA-15175
Type: Bug Bug
Status: Resolved Resolved
Resolution: Handled by Support
Priority: Major Major
Assignee: Dushan Hanuska [Atlassian]
Reporter: Andy Goldman [Atlassian]
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JIRA

Using a custom multi-picker field Notify Users throws exception

Created: 30/Jun/08 01:48 PM   Updated: 14/Jul/08 11:10 PM
Component/s: Custom Fields
Affects Version/s: 3.12.3
Fix Version/s: None

Time Tracking:
Original Estimate: 3 hours
Original Estimate - 3 hours
Remaining Estimate: 0 minutes
Time Spent - 1 hour, 30 minutes
Time Spent: 1 hour, 30 minutes
Time Spent - 1 hour, 30 minutes Time Not Required

Issue Links:
Reference
 

Participants: Andy Goldman [Atlassian] and Dushan Hanuska [Atlassian]
Since last comment: 8 weeks, 4 days ago
Resolution Date: 01/Jul/08 11:22 PM
Labels:


 Description  « Hide
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:

  1. Create issue
  2. Go into the TIA ITR's project
  3. Issue Type IT Request

The error is thrown.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.