I am upgrading a plugin to make it comptable with Jira 5.0.2.
The plugin will save the previous assignee to a custom field in issue in listener method.
The code is as follow:
Issue issue = event.getIssue();
String assigneeName = getPreviousAssigneeValue(event);
customField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(customField), assignee), new DefaultIssueChangeHolder());
The getPrevisouAssigneeValue(event) can return the correct User name as String type.
But the customField.updateValue does not work.
Can any body help me?
And the implementation of the customfield type is
public class PreviousAssigneeCFType extends ReadOnlyCFType {
private final UserManager userMgr;
public PreviousAssigneeCFType(UserManager userMgr,
CustomFieldValuePersister customFieldValuePersister,
StringConverter stringConverter,
GenericConfigManager genericConfigManager) {
super(customFieldValuePersister, stringConverter, genericConfigManager);
this.userMgr = userMgr;
}
public String getSingularObjectFromString(final String string)
throws FieldValidationException {
return userMgr.getUser(string).getName();
}
}
Thanks & Regards,
Yaoyu