When the attribute (Dept) returned is null, I can not figure out how to check for the condition. If I don't append with blank, I will get an error. If I append blank, the result is "null".
function SetUserAttribute(sField, sAttribute)
{ var oParticipant = WorkItem.assignedTo;
if (oParticipant != null) {
var str = oParticipant.attributes.item(sAttribute);
if ((str != null) && (str != "null")) {
WorkItem.setFieldValue(sField,str+"");
}
}
}