It's all about the answers!

Ask a question

DNG javascripting - practical example of using RM.Data.getCurrentUser ?


Steven Hovater (10920) | asked Jul 11 '19, 8:06 a.m.

 Hi all

Using 6.0.6.1, 
// Report the ID of the current user
reportUserId = function() {
    RM.Data.getCurrentUser(function(result.data) {
        if (result.data) {
            report('Current user is: ' + result.data.userId);
        } else {
            error('Unable to determine current user.');
        }
    });
};
    
So, where does "result" come from?

Working example, anyone?

thanks,
Steve

One answer



permanent link
Steven Hovater (10920) | answered Jul 11 '19, 8:30 a.m.

 Got it.

RM.Data.getCurrentUser(function(result) {
if (result) {
println('Current user is: ' + result.data.userId);
} else {
println('Unable to determine current user.');
}
});

Your answer


Register or 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.