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

How to set Planned For and Category for template initialized via RTC Java API and instantiateTemplate method

 Hi,


I was able to create instance of work item template using RTC Java plain APi.
Map<IAttributeVariable, Object> arg1 = new HashMap<IAttributeVariable, Object>();
Map<String, String> arg2 = new HashMap<String, String>();
service.instantiateTemplate(handle, arg1, arg2, monitor);
But I have problem with setting up Planned For and Category before creating instance of the template.

I know how to access attribute handle using findAttribute menthod but it is returns IAttribute type, not IAttributeVariable that is required by instantiateTemplate.

Any ideas how to conver IAttribute to IAttributeVariable or how exactly I should specify Planned For or Category before instanciating template ?

2 votes

Comments

I would suggest to search in the SDK for

instantiateTemplate

and find out how this is used within RTC.

 Ralph.


Maybe that will be surprize but I did that already. All the references to instatiateWorkItemTemplate are using empty lists of variables as input.

Bummer. I did not try to insult you, I just described the approach I would have taken. I don't have a solution.

 Ralph,


You didn't insult me at all :) When somebody is coming to me with simiar questions I am sending them to google or SDK as well. I already found solution to solve it. It is published below.



Accepted answer

Permanent link

That solved the issue

IAttributeVariable categoryAttribute = new AttributeVariable(ITemplateAttributeIdentifiers.WORKITEM_CATEGORY, ITemplateTypeIdentifiers.CATEGORY);
IAttributeVariable iterationAttribute = new AttributeVariable(ITemplateAttributeIdentifiers.WORKITEM_ITERATION, ITemplateTypeIdentifiers.ITERATION);
    

Ralph Schoon selected this answer as the correct answer

1 vote

Comments

Nice! Thanks For sharing Bartosz!

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,934
× 411
× 233
× 169
× 48

Question asked: May 17 '17, 10:31 a.m.

Question was seen: 3,311 times

Last updated: May 17 '17, 3:18 p.m.

Confirmation Cancel Confirm