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

How to set values in Workitem List attribute using server API

 Hi,


I am Using CLM 5.0.1
I am able to access and set work item list attribute value using server java API.
But if attribute of type work item list is already having some work items and i need to add one more work item in it using server java API. How to do it?

Any idea??

0 votes


Accepted answer

Permanent link

I've recently done that (in CLM 6.0.3), it is straightforward.

Basically, these are the steps:
  1. get the current value of the WI List attribute, as a List object;
  2. get the work item you want to add, as a IWorkItem object;
  3. add the work item to the List, using the add method;
  4. set the List as the new value of the attribute, using the setValue method (see the examples provided by Ralph):
  5. save the work item that contains the attribute you've updated (using the saveWorkItem3 method in the examples).
According to your post, you should already be able to perform steps 1, 4 and 5, and step 3 is very simple.
Just retrieve the work item you want to add to the list.

Pallavi Deore selected this answer as the correct answer

0 votes


One other answer

Permanent link

The server API works exactly like the client API in most of the areas. Here how to save in the server API: https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/

A list attribute is a List and the interface provides an add to add the data that is missing.So you make sure the list contains that it is supposed and then save, I think. See https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/

0 votes

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

Question asked: May 29 '18, 8:11 a.m.

Question was seen: 2,010 times

Last updated: May 30 '18, 2:40 a.m.

Confirmation Cancel Confirm