It's all about the answers!

Ask a question

Access custom attribute value through Rest API


pere irazusta (2062120) | asked Nov 17 '11, 6:10 a.m.
Hi,

I'm trying to acces the value of a custom attribute through the Rest Api but I can't find how. I've doing some test based on:
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI#workitem

I've been able to to acces some data from the custom attribute with:

...workitem/workItem/customAttributes|(identifier|attributeType )

but still can't get the value itself.

Any idea? Thanks!

Pere

4 answers



permanent link
Jon Agnew (8123) | answered Nov 17 '11, 1:07 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR
Hi Pere,

In the Reportable REST API, there are two ways you can access those values. Either use the type-specific properties

...workitem/workItem/booleanExtensions/(key|value)
...workitem/workItem/integerExtensions/(key|value)
...workitem/workItem/doubleExtensions/(key|value)
...workitem/workItem/smallStringExtensions/(key|value)
...workitem/workItem/mediumStringExtensions/(key|value)
...workitem/workItem/largeStringExtensions/(key|value)
...workitem/workItem/timestampExtensions/(key|value)

or the allExtensions property which returns all types in a single call.

...workitem/workItem/allExtensions/(key| type| booleanValue| integerValue| longValue| doubleValue| smallStringValue| mediumStringValue| largeStringValue| timestampValue| decimalValue)

The API doesn't seem to provide a way to access all values; as far as I can tell it's limited to enumerations and attributes of the data types listed above.

Jon

permanent link
pere irazusta (2062120) | answered Nov 18 '11, 3:45 a.m.
Thanks for your answer!

With the option ..workitem/workItem/allExtensions/ it has worked perfectly!

permanent link
ying zhang (611) | answered Nov 11 '12, 9:26 p.m.
Hi pere,I met the same problem with you,can you give me an example how to get the custom attribute value?

permanent link
Guenther Jornitz (5310) | answered Apr 16 '13, 4:45 a.m.
Hi Pere/Ying,
I met the same problem... is there a way how I can get the value of a specific custom attribute in a workitem?

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.