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

Creating category programmatically

Hi,

I'm trying JUnit tests for some process-related functions. My main goal is to create some work items for testing. I have successufully been able to create project area and initialized it programmatically. Now, I am trying to create a new category and save it to the new project area that I created by doing this:
// Setup categories in the project area.
IAuditableClient auditableClient= (IAuditableClient) fTeamRepo.getClientLibrary(IAuditableClient.class);
CategoriesManager catManager = CategoriesManager.createInstance(auditableClient,
fProjectArea, null);
CategoryTreeNode rootNode = catManager.getRoot();
CategoryTreeNode childCat = rootNode.createChil(CATEGORY_ID);
catManager.save(null);

But I got an error "Permission denied", I couldn't save the category.

If I continued to create a work item, using:
IAuditableClient auditableClient= (IAuditableClient) fTeamRepo.getClientLibrary(IAuditableClient.class);
WorkItemInitialization operation= new WorkItemInitialization(summary, category);
IWorkItemHandle handle= operation.run(workItemType, null);
IWorkItem workItem= auditableClient.resolveAuditable(handle, IWorkItem.FULL_PROFILE, null);

I got an error ItemNotFound, saying it couldn't find the Category that I gave as argument.

Can you help me out, please?

Thanks

0 votes



One answer

Permanent link
It seems that the process governing your project area does not grant
permission to save a work item category to the caller of
CategoriesManager#save.

You process specification needs to grant the permissions for the
"com.ibm.team.workitem.server.saveCategory" project operation to the
appropriate role. I.e. on of the roles assigned to the caller in the
project area.

Kai
Jazz Process team


petcharatv wrote:
Hi,

I'm trying JUnit tests for some process-related functions. My main
goal is to create some work items for testing. I have successufully
been able to create project area and initialized it programmatically.
Now, I am trying to create a new category and save it to the new
project area that I created by doing this:
// Setup categories in the project area.
IAuditableClient auditableClient= (IAuditableClient)
fTeamRepo.getClientLibrary(IAuditableClient.class);
CategoriesManager catManager =
CategoriesManager.createInstance(auditableClient,
fProjectArea, null);
CategoryTreeNode rootNode = catManager.getRoot();
CategoryTreeNode childCat = rootNode.createChil(CATEGORY_ID);
catManager.save(null);

But I got an error "Permission denied", I couldn't save the
category.

If I continued to create a work item, using:
IAuditableClient auditableClient= (IAuditableClient)
fTeamRepo.getClientLibrary(IAuditableClient.class);
WorkItemInitialization operation= new WorkItemInitialization(summary,
category);
IWorkItemHandle handle= operation.run(workItemType, null);
IWorkItem workItem= auditableClient.resolveAuditable(handle,
IWorkItem.FULL_PROFILE, null);

I got an error ItemNotFound, saying it couldn't find the Category that
I gave as argument.

Can you help me out, please?

Thanks

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

Question asked: Jul 25 '08, 7:35 p.m.

Question was seen: 7,771 times

Last updated: Jul 25 '08, 7:35 p.m.

Confirmation Cancel Confirm