how to get user's uuid by user id in java script for RTC?

Accepted answer

if (!team || !role) {
console.log('getTeamMembersWithRole: Error! team = ' + team + ', role = '
+ role);
return null;
}
var xhrArgs = {
url : '/ccm/rpt/repository/foundation?fields=foundation/teamArea[itemId='
+ team
+ ']/roleAssignments/(contributor/itemId|contributorRoles/name)',
headers : {
'Accept' : 'application/xml'
},
handleAs : 'xml'
};
return jazzClient.xhrGet(xhrArgs).then(
function(data) {
var memberIds = data.evaluate(
'foundation/teamArea/roleAssignments[contributorRoles/name/text()="'
+ role + '"]/contributor/itemId', data, null,
XPathResult.ANY_TYPE, null);
var members = [];
var id = memberIds.iterateNext();
while (id !== null) {
members.push(id.textContent);
id = memberIds.iterateNext();
}
return members;
});
};
Comments

The reason why customers broke their tools was not due to the fact that the scripts would have been synchronous. It was due to the fact that nobody considered that customers could have hundreds of team areas and timelines and iterations. This cased the communication to the server so excessive that the browser hoarded the available memory, locking the laptop, and the work items would not load anymore.

Also note that this caused a Management level crit sit, cost tenth of thousands of $, weeks of travel time, impacted hundreds if not thousands of users and heavily impacted the acceptance and reputation of our tools, because, of course this was recognized as an IBM defect, because there is no way of telling that this was caused by a customization.


The customer claimed they had tested it.

To sum it up, we also identified several enhancements to use heavy caching for categories, timelines and some other information needed to edit work items. The data shapes the customer generated was never anticipated by our development.

Also note that this did not show up for all users. Also most complaints came from one location.

BTW, thanks for sharing Davyd!

One other answer

This is not supported by the supported and documented JavaScript API for attribute customization. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization for a comprehensive documentation of the supported JavaScript API.