It's all about the answers!

Ask a question

JavaScript / EWM: Custom Presentation - How to add work item to work item list attribute?


Kevin Johnson (116) | asked Nov 13 '20, 1:49 p.m.
edited Nov 13 '20, 1:53 p.m.

Hello,

We are developing a custom presentation for a work item list attribute. After the user creates a new work item we need to add it to our work item list attribute. Note: This is an attribute of kind work item list. It is not a link.

How do we add a work item to the work item list attribute?

I get the current work item list just fine:

var workItemList = this.workingCopy.getValue( {
                            path: ["attributes", this.attributeId ],
                        });

workItemList is set to (for example):
{
​_eQualifiedClassName: "com.ibm.team.workitem.rest.dto:ListDTO",
items: (1) [
​​0: Object { itemId: "_7OqAYCT5EeubHdT_idS2yQ", stateId: "_7PGFTyT5EeubHdT_idS2yQ", _eQualifiedClassName: "com.ibm.team.workitem.rest.dto:WorkItemDTO", … }
​​],
length: 1,

}

How do we add to this list and update the work item list attribute value? Do we need to (somehow) create a new WorkItemDTO? Add it to the Items array? And then call .setValue()? Thank you for any help and advice.

Regards,
Kevin

Be the first one to answer this question!


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.