It's all about the answers!

Ask a question

Is a Default Value or Calculated Value script supported for Subscribers attribute?


Daniel Reilly (1431620) | asked Feb 03 '13, 3:18 p.m.
I need to automatically add contributors to the subscribers attribute.  But, it can only be for certain types of work items, under certain conditions, in certain projects.  I have similar scripts for other built in attributes, but need some information on how to handle a user list with scripting, which I can't find.  Is this supported?

One answer



permanent link
Ralph Schoon (63.5k33646) | answered Feb 03 '13, 4:07 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Feb 03 '13, 4:23 p.m.
 Daniel,

The Subscribers (similar to Attachments and Links) is not an attribute, as far as I can tell. It actualy is a collection of objects, at least from an API perspective. So, as far as I can tell, you can not modify the subscribers in JavaScript. You can find more information in https://jazz.net/library/article/1093, which includes references to the Wiki article about javaScript based customization. In that page, as far as I can tell, is no attribute ID for the subscribers.

You could manipulate subscribers in a Participent, similar to using the client API used in https://rsjazz.wordpress.com/2012/08/02/subscribing-to-a-work-item-using-the-java-api/. Other posts there show examples for Participants and links to the Extensions Workshop to learn how to set up your environment.



Comments
Daniel Reilly commented Feb 03 '13, 4:32 p.m.

Ralph,

There is an attribute definition for subscriptions, but a regular contributor UUID result from a script causes an exception:

 <attributeDefinition id="com.ibm.team.workitem.attribute.subscriptions" name="Subscribed By" type="subscriptions">
    <dependsOn id="category"/>
    <dependsOn id="target"/>
    <defaultValueProvider providerId="com.ibm.team.ims.attribute.defaultValueProvider.owner"/>
</attributeDefinition>

!MESSAGE An internal error has occurred.
!STACK 0
com.ibm.team.repository.common.TeamRepositoryException: Internal error
    at com.ibm.team.apt.internal.ide.ui.common.structure.JavaScriptItemMovePolicy.executeCreate(JavaScriptItemMovePolicy.java:487)
    ... more

Do you know what kind of result it is looking for?  And if there is a way to supply it via scripts?

Thanks

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.