{ "id": "153906", "key": "TIMOB-20152", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-02-16T06:34:10.000+0000", "created": "2015-12-17T01:33:18.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-5.1.2" ], "versions": [ { "id": "17532", "name": "Release 5.1.1", "archived": false, "released": true, "releaseDate": "2015-11-24" } ], "issuelinks": [], "assignee": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2016-02-16T06:34:15.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5. Description:\r\nWhilst working on an automated test for {{Ti.Contacts.Person}} properties, an issue was found when attempting to retrieve the properties using {{Ti.Contacts.getPeopleWithName}}. fields with single string values were returned as intended, however fields with arrays such as {{email}} do not return the correct value (i.e. {{[object Object]}} or an error with be thrown using the following code: {{Ti.API.info(\"person: \" + person.email.home[0]);}} ) \r\n\r\nHowever, a workaround to this issue is to use the method {{Ti.Contacts.getPersonByIdentifier}} , which correctly returns fields with array values. \r\n\r\nConfirmed that this is *not* a regression.\r\n\r\nh5. Steps to reproduce: \r\n1. Create a new Classic project.\r\n2. use demo code: \r\n{code:java}\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar saveID = \"\";\r\n\r\nvar Ncook = new Object();\r\nNcook.firstName = \"Nathaniel\";\r\nNcook.lastName = \"Cook\";\r\nNcook.middleName = \"John\";\r\nNcook.nickname = \"Fish\";\r\nNcook.prefix = \"Mr\";\r\nNcook.suffix = \"III\";\r\nNcook.firstPhonetic = \"N\";\r\nNcook.middlePhonetic = \"T\";\r\nNcook.lastPhonetic = \"A\";\r\nNcook.organization = \"appcelerator\";\r\nNcook.department = \"Cloud\";\r\nNcook.jobTitle = \"QE\";\r\nNcook.note = \"You gotta risk it, to get the biscuit\";\r\nNcook.email = {\r\n home : [\r\n 'myGmail',\r\n 'myHotmail'\r\n ],\r\n work : [\r\n 'myWorkemail'\r\n ]\r\n \t};\r\n// Ncook.address = \"\";\r\n// Ncook.phone = \"\";\r\n// Ncook.instantMessage = \"\";\r\n// Ncook.relatedNames = \"\";\r\n// Ncook.date = \"\";\r\n// Ncook.url = \"\";\r\n\r\nvar singleValue = [\r\n 'firstName', 'lastName', 'middleName', 'nickname', 'prefix', 'suffix', 'firstPhonetic', 'middlePhonetic', 'lastPhonetic', 'organization','department', 'jobTitle', 'note'\r\n];\r\n\r\nvar multiValue = [\r\n'email', 'address', 'phone', 'instantMessage', 'relatedNames', 'date', 'url'\r\n];\r\n\r\nnewNathan = Ti.UI.createButton({\r\n\ttitle: \"New Nathan\",\r\n\ttop: '20%'\r\n});\r\n\r\nnewNathan.addEventListener('click', function(){\r\n\t\r\n\tvar newCook = Ti.Contacts.createPerson(Ncook);\r\n\t// saveID = newCook.getIdentifier();\r\n\t// Ti.API.info(saveID);\r\n});\r\n\r\n\r\nbutton2 = Ti.UI.createButton({\r\n\ttitle: \"Compare Nathan\",\r\n\ttop: '40%'\r\n});\r\n\r\n\r\nbutton2.addEventListener('click', function(){\r\n\t\r\n\r\n var people = Ti.Contacts.getPeopleWithName(\"Nathaniel\");\r\n\r\n// var people = Ti.Contacts.getPersonByIdentifier(saveID);\r\nTi.API.info('Total contacts: ' + people.length);\r\n\r\nvar person = people[0]; \r\n// var person = people;\r\n\r\nTi.API.info(\"Ncook: \" + Ncook.email.home[0]);\r\n Ti.API.info(\"person: \" + person.email);\r\n//Ti.API.info(\"person: \" + person.email.home[0]);\r\n Ti.API.info(\"person: \" + person.lastName);\r\nTi.API.info(\"-----------------------------------------\");\r\n for (var j=0, jlen=singleValue.length; j