It's all about the answers!

Ask a question

RTC 6.0.1 - Getting Attribute Data from parent during child work item creation as default value.

vishnudharan manivannan (1183142) | asked May 26 '16, 8:16 a.m.
 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: 
	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);
		// here there are no references returned by the default value 

Thanks in Adavance,

One answer

permanent link
Donald Nong (14.5k414) | answered May 26 '16, 9:05 p.m.
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".

vishnudharan manivannan commented May 27 '16, 1:53 a.m.

 Hello Donald,

Could you please provide us a way of solution of how we can achieve this functionality?

Thank You.

Donald Nong commented May 27 '16, 3:10 a.m.

I can only think of the way that I described above, but I don't know whether it's doable or with which APIs, as I am not doing any actual development work with the Java API.

Your answer

Register or to post your answer.