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.
Accepted answer
One other answer
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.
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.
HashMapThe code then uses the setValue to set the attribute like yours does.workItems = findWorkItemsByIDValues( parameter.getValue(), notFoundList, ITEM_SEPARATOR); Collection workItemList = workItems.values(); if (workItemList.size() > 0) { return workItemList.iterator().next(); } else {