Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes

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.


Accepted answer

Permanent link
...

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

1 vote


3 other answers

Permanent link
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.

0 votes

Comments

thanks for the additional info.. unfortunately I don't think there is a way to get the current user value in javascript.


Permanent link
thanks,
Don't exist any way to condition this ???

0 votes


Permanent link
:)
Thanks Sam.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,122

Question asked: Dec 22 '14, 7:51 a.m.

Question was seen: 4,005 times

Last updated: May 18 '15, 7:16 a.m.

Confirmation Cancel Confirm