How to get Contributor Name by Javascript
![]()
Hi all,
I'm writing a Javascript extension and I need to get the name of the owner of a workitem. The function workItem.getValue(WorkItemAttributes.OWNER) returns an handle (e.g. _YNh4MOlsEdq4xpiOKg5hvA). Is there any way to get the attributes (Name, Mail ...) from the Contributor's handle? Thanks in advance, Marco |
Accepted answer
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Sep 11 '14, 1:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Sep 11 '14, 1:58 a.m.
I don't know since when, but you can access the name of a contributor in a contributor type attribute.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization in the section API for Javascriptmentions, workItem.getValue(attributeID) as well as workItem.getLabel(attributeID). The letter returns the contributor name. The first one the UUID.Ralph Schoon selected this answer as the correct answer
|
2 other answers
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Jul 05 '12, 4:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I know you can't access the contributor name in Javascript. The API is still very limited for IItems. You get the value. so you can more or less only work with string based attributes. This is mentioned in the WiKi article.
we discussed this several times here already. As an example this thread: https://jazz.net/forum/questions/71806/contributor-name-in-work-item |
![]()
Ralph,
In this link is mentioned that we can acces the WorkItemAttributes.CREATOR, but this returns "_bgEx0DK8EeSsIskz45a9zw" too. I am using version 4.0.7. Do you know if in this version is possible to obtain the name of creator (or ID of creator) in JavaScript?
|
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.