It's all about the answers!

Ask a question

How do I set a Contributor attribute from a Javascript based Calculated Value?


Henrik Jönsson (1537) | asked Jan 16 '15, 7:29 a.m.
 I need to set a Contributor (e.g. Owner) in Javascript. Somehow I guess that I need to get the user id. How can I find that from a given username?

Comments
Jonas Studer commented Jan 16 '15, 7:43 a.m.

I've built my own user-management to do such things...

Get the users through this script
"dojo.provide("com.ibm.team.process.web.client.internal.ProcessClient")"

Use this method to do so:
function getMembersPaged(args, responseHandler){

Then parse throught the loaded datas..

Or the second and mybe better solution, is to load them via REST-Calls
There you could set the params you'll need.
Those scripts I suggested first are not open and not declared in the API

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Jan 19 '15, 4:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can not find the User ID from a given user name in a JavaScript attribute customization. You can print the ID and then put it into a script. See https://jazz.net/library/article/1093 Lab 5 for more explanations and examples. See https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ for how to use Java instead, where you have more access to complex items.

Your answer


Register or to post your answer.