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
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
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
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.2 other answers
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
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?
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?