It's all about the answers!

Ask a question

Contributor Name in Work Item


il tt (4154) | asked Feb 14 '12, 4:42 a.m.
Hi,

I'm trying to get the contributor name in my script WorkItem. I need the contributor name to customize another field in my WI with Contributor name and other informations.

I have tried to get this information as the rest of types but it is not working:

var contributorAttribute = parameters.getString("contributorAttribute");
var name= workItem.getValue(contributorAttribute);

Can anyone help me?

Kind regards,
Elisa.

5 answers



permanent link
Ralph Schoon (63.1k33646) | answered Feb 14 '12, 6:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Elisa,

please look at https://jazz.net/library/article/537/
and follow the links to https://jazz.net/wiki/bin/view/Main/AttributeCustomization . The latter describes, roughly, what can and can not be done with scripts. My experience is that, at least with 3.0.1.1, the only information I get out of a contributor is the ID. I don't know a way to get to the name. Maybe others do.

There are other value providers and conditions that allow to solve some of the implications of this fact. The default vale provider for example allows to set an attribute to the creator of a work item.

permanent link
il tt (4154) | answered Feb 14 '12, 7:21 a.m.
Hi,

Could be possible to have the name from the ID Contributor?

Regards,
Elisa.

permanent link
Ralph Schoon (63.1k33646) | answered Feb 14 '12, 7:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I do not know a way to do that, otherwise I would have mentioned it. I don't think the script API currently provides that.

permanent link
il tt (4154) | answered Feb 14 '12, 7:40 a.m.
Hi,

Thanks for your answer.

I'm trying to look for an dojo library that allow me that (have access to the Contributor Class functions) but I can not find. Has anybody done that before?

Regards,
Elisa.

permanent link
il tt (4154) | answered Feb 15 '12, 10:12 a.m.
Hi,

Because this solution is not possible I have thought in other but I'm not sure I can do that.

Use an enumeration with all users instead of Contributor.
Problems:
- In the script when I want to have the name of the user I have an enumeration like UserName.literal.l4, I have read in the version 3.5 we could have available the function getLabel but now how could we have the label instead the literal?
- I have lose the link connection to the RTC user. Could I create that?

Thanks.

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.