Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How do I update a custom attribute of type contributor list from the java API so that I can bypass the voting restrictions?

We're trying to figure out how to use the voting functionality but we also need to figure out how to translate some manually cast votes onto a work item on behalf of somebody else. The voting functionality prevents being able to cast a vote for somebody else. But I'm hoping that this could be bypassed by an admin by going through the java API. 

Following Ralph's blog about getting work item attributes I have no problem getting the Object from IWorkItem.getValue(). But I'm not sure what type of Object I'm getting back, it appears to be a "com.ibm.team.workitem.common.internal.util.DelegatingItemList", but how can I modify this object and then update the value? 

I'm in the process of downloading the SDK in the meantime hoping there'll be some examples in there, but was hoping somebody could lead us in the right direction. 

0 votes



One answer

Permanent link
You create a List of IContributors or IContributorHandles and pass that in the set. Or you get the value, cast the object to a List and read the entries.
This pattern is used for all multi-value attribute types.

See the code in A RTC WorkItem Command Line Version 2.2 for how to do that.

If you try that on Jazz.net, it is cheating!

0 votes

Comments

I was able to get the code working so that it attempts the update, but I get the same error that the web ui throws. Any other ideas how we might be able to do a vote for somebody else? Is there a way to do impersonation through the java API?

CRRTC0303E: You can cast one vote only. Adding or removing another contributor from the voters list is not allowed.

From what I can tell this is being done by VotesParticipant extends WorkItemSaveParticipant. I guess this particular work item save participant always runs and can't be configured in a process configuration? It seems that disabling the voting feature doesn't disable it (even with a server reset & bounce).

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,939

Question asked: Apr 30 '15, 10:51 a.m.

Question was seen: 3,555 times

Last updated: May 01 '15, 10:54 a.m.

Confirmation Cancel Confirm