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

set value for custom attribute of type "workItem"

 I have a custom attribute of type "workItem"
Trying to set value in Java plain client like this:
//wc is working copy
IWorkItem workItemNew = wc.getWorkItem();
IAttribute backportAttirbute = RhpWorkitemUtils.getCustomAttribute("backport", workItemNew);
workItemNew.setValue(backportAttirbute, workItemOrig); //workItemOrig is existing workitem
//continue with save as usual

The code does not throw any exception, but I see no effect in the workitem.
Other custom attributes are being set well.
Looks like I am missing how to correctly modify this type.

0 votes


Accepted answer

Permanent link
We figured Moti's code was OK, but the presentation configuration was wrong, so it did not show anything.
Ralph Schoon selected this answer as the correct answer

1 vote


One other answer

Permanent link
Hi Moti,

you can find examples for how that API works here: https://rsjazz.wordpress.com/2015/01/12/a-rtc-workitem-command-line/

You have to return an IWorkItem. Your code looks OK to me. Here is some code that works for me.
		HashMap workItems = findWorkItemsByIDValues(
				parameter.getValue(), notFoundList, ITEM_SEPARATOR);
		Collection workItemList = workItems.values();
		if (workItemList.size() > 0) {
			return workItemList.iterator().next();
		} else {

The code then uses the setValue to set the attribute like yours does.

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,938
× 169

Question asked: Feb 05 '15, 4:30 a.m.

Question was seen: 4,072 times

Last updated: Feb 05 '15, 5:25 a.m.

Confirmation Cancel Confirm