RTC 6.0.1 - Getting Attribute Data from parent during child work item creation as default value.
Hello Everyone,
The User is in the US work item. There is a custom attribute (say Field1) with some data HTML text data.
Now the user clicks on link > Add Children > Create new Linked task
Here is there a possibility to get the Data of Field1 from US as a default value in Field2 of TASK??
Steps Tried to Achieve the same(Not Successful):
Java Based Default Value:
@Override public String getDefaultValue(IAttribute attribute, IWorkItem workItem, IWorkItemCommon workItemCommon, IConfiguration configuration, IProgressMonitor monitor) throws TeamRepositoryException { String testDeafult = ""; IWorkItemReferences ref = workItemCommon.resolveWorkItemReferences(workItem, monitor); IEndPointDescriptor linkDescriptor = WorkItemEndPoints.CHILD_WORK_ITEMS; List<IReference> linkRef = ref.getReferences(linkDescriptor); if(linkRef.isEmpty()) { // here there are no references returned by the default value } }
Thanks in Adavance,
One answer
I don't think it will work that way. What you want to do is called "pre-fill". Basically, your "create" action should get the data from existing work item, and send it along to the creation process of the new work item. In other words, the creation process should have such data _before_ creating a new work item. If you create a new work item first and try to find associated data from within, it will fail, as the new work item is essentially "blank".