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

Get list of all Categories from server side

Hi,

I'm developing a server side plugin that enables to setCategory of a workitem depending on the value of other workitem fields.

I've found some snippets that solve this issue ( listting all the catgories and getting one of them) before setting it but using client side libs.

 IWorkItemClient workItemClient = (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);

...
ICategoryHandle category = workItemClient.findCategoryByNamePath(projectArea, path, null);
wc.getWorkItem().setCategory(category )



Any idea on how to do it from server side?

Thanks!

Pere

0 votes



3 answers

Permanent link
Hi Pere,

on the server, provided your extension extends the AbstractService (which it should) you can use the getService() operation to get the services that provide this. In your case:


IWorkItemCommon common = (IWorkItemCommon)getService(IWorkItemCommon.class);
common.findCategoryByNamePath(projectArea, namePath, monitor)

0 votes


Permanent link
Thanks Ralph for your quick answer!

It looks like it will work fine.

I 'll let you know the final results.

Pere.

0 votes


Permanent link
We have just started using RTC for managing product enhancement requests. A few challenges are left. One of them is this:

We want to populate the "Owned By" field based on the selected value for a "Product" field? For each product we have one product owner. How/where can we maintain a product - product owner table and what would a script to set the "Owned By" field look like. (assuming it can be scripted)

thanks!
Jos.
p.s. we do know some JavaScript, but are new to building script for RTC

0 votes

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,937

Question asked: Feb 27 '12, 6:59 a.m.

Question was seen: 5,954 times

Last updated: Feb 27 '12, 6:59 a.m.

Confirmation Cancel Confirm