How to get user loged in RTC for customization
hello, as I can get for this script the user logged this for comparison if the same user owner to determine functionality.
thx. |
Accepted answer
...
dojo.require("com.ibm.team.repository.web.client.session.Session");
...
Very easy
(function() {
...
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
var getAuthenticatedContributor = com.ibm.team.repository.web.client.session.getAuthenticatedContributor;
dojo.declare("com.ibm.san.ariadna.process.SampleReadOnlyCondition", null,
{
matches : function(workItem, configuration) {
var loggedInUser = getAuthenticatedContributor().itemId;
var owner = workItem.getValue(WorkItemAttributes.OWNER);
var result = (loggedInUser != owner);
return result;
}
});
})();
Ralph Schoon selected this answer as the correct answer
|
3 other answers
Sam,
I'm using 'Script based condition' and I need to restrict the change of an attribute only if the logged user is the same owner workItem. and I have the 'owner' of Workitem(workItem.getLabel("owner");), but not how to get the user logged to compare and condition. or is there another way to do this? thx. Comments
sam detweiler
commented Dec 22 '14, 10:01 a.m.
thanks for the additional info.. unfortunately I don't think there is a way to get the current user value in javascript.
|
thanks,
Don't exist any way to condition this ??? Comments
sam detweiler
commented Dec 22 '14, 10:22 a.m.
It may be possible using a a JAVA based handler..
|
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
please explain a little more.. script? mean javascript? value, default, ???
I don't think you can get the current contributor (or set those type fields) with script extensions to field handling in javascript.