Contributor Name in Work Item
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.
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
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.
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.
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.
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.