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

Programmatic WorkItem - Documentation

I want to import/add workitems to Jazz from my bug log file. I try to base on example, which is on this page:
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation

I want to add more fields defining workitem. So I need some information about classes used in this example. Where can I find documentation?

0 votes



6 answers

Permanent link
In general, you can set attributes using the generic
IWorkItem#setValue(attribute, value) method.

For this, you need the attribute, which can be obtained using

IAttribute attribute= IWorkItemClient#findAttribute(projectArea,
attributeId, monitor);

The attributeId can be one of the property constants defined on
IWorkItem, e.g. IWorkItem.PRIORITY_PROPERTY.

1. How to set workitem priority on High? ( How use
setPriority function ? )

You can get the available priorities using

IAttribute priority= workItemClient.findAttribute(project,
IWorkItem.PRIORITY_PROPERTY, monitor);
IEnumeration<IPriority> priorityEnum=
IWorkItemCommon.resolveEnumeration(priority, monitor);

// Get the list of priorities
List<IPriority> priorities= priorityEnum.getEnumerationLiterals();

IPriority priorityLiteral= ... // select one of the list above
workItem.setValue(priority, priorityLiteral.getIdentifier2());

2. How to set FoundIn attribute ?

IDeliverableHandle deliverable= ... // Find a deliverable using one of
the IWorkItemClient#findDeliverable* methods

IAttribute foundIn= workItemClient.findAttribute(project,
IWorkItem.FOUND_IN_PROPRTY, monitor);
workItem.setValue(foundIn, deliverable);

3. How to set Planned for attribute ?

IIterationHandle iteration= ...
IAttribute plannedFor= workItemClient.findAttribute(project,
IWorkItem.TARGET_PROPERTY, monitor);
....

Regards,
Patrick
Jazz Work Item Team

1 vote


Permanent link
I need information:
1. How to set workitem priority on High? ( How use setPriority function ? )
2. How to set FoundIn attribute ?
3. How to set Planned for attribute ?

Thank you
Anna

0 votes


Permanent link
Thank you for response. I am new with Jazz and intermediate Java programmist and unfortunately I still have problem :(

1. How to set workitem priority on High? ( How use
setPriority function ? )
Done


How to set FoundIn attribute ?


I have problem with:
IDeliverableHandle deliverable= workItemClient.findDeliverableByName(projectArea, "aaa", null, monitor);

I put null in ItemProfile<IDeliverable> parameter. What shoud I put here?

Now I get:
Exception in thread "main" java.lang.NullPointerException
at com.ibm.team.workitem.common.internal.WorkItemCommon.findDeliverableByName(WorkItemCommon.java:438)


How to set Planned for attribute ?


IIterationHandle iteration= ...
I can't initialize IIterationHandle. :(


Thank you again.

0 votes


Permanent link
I have problem with:
IDeliverableHandle deliverable=
workItemClient.findDeliverableByName(projectArea, "aaa",
null, monitor);

I put null in ItemProfile<IDeliverable> parameter. What shoud I
put here?

You can use IDeliverable.SMALL_PROFILE. The profiles define which
attributes of the item will be loaded from the server. See also the
class ItemProfile.

Regards,
Patrick
Jazz Work Item Team

0 votes


Permanent link
I still have o problem with plannedFor attribute. I don't understand how this all classes are connected with each other.

I don't know how to find IIterationHandle for "aaa". I tried in some ways and nothing works.

0 votes


Permanent link
Hi


How do get all the values of Planned for attribute using plain java.



Thanks,

Pugazh

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: Nov 17 '08, 7:26 a.m.

Question was seen: 9,336 times

Last updated: Nov 17 '08, 7:26 a.m.

Confirmation Cancel Confirm