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

Server api to get the Project area

Hi all,

I want to create work item in server programmatic in RTC 4.0.1. So we need the Project Area to create the work item.

Below code is to get the Project Area.
IProcessServerService processServerService = getService(IProcessServerService.class);
IProjectArea projectArea = (IProjectArea)processServerService.findProcessArea(areaUri, null);

But, How do I get the current working areaUri?

0 votes



6 answers

Permanent link
Hi,
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation has information on how to create work items programmatically and may help get you started.

1 vote

Comments

Hi Lauren,

Thanks for the information, but the link you have provided has the client api. And the project name, user and other details have been hardcoded.

I want to create a work item on server using server api, and need to get the project name, user and details at runtime.


Permanent link
If you want some more advice, you need to provide more useful context information, such as, for example, in which context you want to do this and what information you have.

I try to provide several API examples for client and server API here. I have examples on creating work items on the server e.g. in a synchronizer on my hard drive. All examples have assumptions on the context you are using. You have to provide useful context to get help.

Lauren's link is a very valid source on how to create work items and use the given data, potentially even in your context.

You are asking complex questions without providing the required context. That makes it impossible to really help. If you can provide useful information about your context, the community might be able to help with additional examples.
 
If you want to find out on your own: In general if you want to create a work item in the server API, as far as I recall, you have to get a workingcopy manager, create/connect a work item, manipulate the work item working copy and save the working copy with the manager. You can search for this in the SDK.  

0 votes


Permanent link
Pancha,

as you've noticed the Server classes and methods are not well documented. the Javadoc only covers the client api.
but it is 'assumed' that you know that a client api also has a server side 'service' api, with similar methods.
and the process is generally the same.

get an instance of the service, and call thru it to do the work you need.
there will be a few 'services' that you will need to use to accomplish your task.

if you can write it up in client code, then its a minor change to use the services on the server side.
but you will have to dig for the info..there are no 'samples' in the SDK, but you can explode the product source bundles and scrounge around in there looking for something similar..

Ralph has done a good job of making useful samples on his blog to help with that

0 votes

Comments

Sam, looking back at this year, I just would like to mention, that your contributions and questions in this forum have been great. They also have been a great inspiration as well as a motivation for my blog. Thank you so much for your contribution! 


Permanent link

Thanks Ralph and Sam.

The context is described below.:

I am trying to develop a process template in CCM. And I want to add some Event Handlers and follow-up actions. In the follow-up action, we have requirement to create work items, for example, on code check-in, perform code review and create work items automatically.

Based on the process template, when we create a project area, the follow-up action should dynamically load the project area, and create the work items in that project. 

The link provided has more information. Will try with the details provided. Thanks all.

 

0 votes

Comments

Pancha, if you work in the context of a followup action, you have a work item and other related information already. Look at the posts here: https://rsjazz.wordpress.com/ for examples. The post tell client or server api, but as Sam states, if you have the client API, the server API is very similar,except you need to find the service that provides it. Looking for something in the SDK named similar to the client API typically does the trick.

Also, be aware, the documentation for the server API is in the SDK. It is not complete and all that, because, it is not "officially" supported. Only what is listed in the plain java client libraries javadoc is officially supported.

If you develop server extensions, you typically extend a server abstract service class. That also provides you with ways to access data.


Permanent link
On a client extension we use:
IProcessItemService service = ...
List projectAreas = service.findAllProjectAreas(IProcessClientService.ALL_PROPERTIES, monitor);
to retrieve all project areas in the repository. If we are on a server extension, which service can we use?
IProcessItemService.class belongs to com.ibm.team.process.client package only.
Thanks in advance.

0 votes


Permanent link
It's an old thread, but in case anyone else (like me) stumbles here, looks like this is a good answer: https://jazz.net/forum/questions/78308/how-to-pass-uri-parameter-to-iprocessserverservicefindprocessarea-method

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

Question asked: Dec 27 '12, 3:51 a.m.

Question was seen: 5,883 times

Last updated: Jun 30 '14, 10:41 a.m.

Confirmation Cancel Confirm