It's all about the answers!

Ask a question

How to get Contributor Name by Javascript


Marco Delato (512114) | asked Jul 04 '12, 1:23 p.m.
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


permanent link
Ralph Schoon (63.6k33646) | 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 Javascript

mentions, 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



permanent link
Ralph Schoon (63.6k33646) | 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

Comments
LUIZ DE ALMEIDA commented Sep 10 '14, 2:52 p.m.

Ralph,

Don't need to answer me. I found the solution in the link you mentioned.


permanent link
LUIZ DE ALMEIDA (23016192) | answered Sep 10 '14, 2:36 p.m.
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


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.