It's all about the answers!

Ask a question

Programmatic WorkItem - Documentation


Annie Lozano (3121) | asked Nov 17 '08, 7:26 a.m.
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?

6 answers



permanent link
Patrick Streule (4.9k21) | answered Nov 18 '08, 4:58 a.m.
JAZZ DEVELOPER
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

permanent link
Annie Lozano (3121) | answered Nov 18 '08, 4:26 a.m.
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

permanent link
Annie Lozano (3121) | answered Nov 19 '08, 3:41 a.m.
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.

permanent link
Patrick Streule (4.9k21) | answered Nov 20 '08, 7:08 a.m.
JAZZ DEVELOPER
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

permanent link
Annie Lozano (3121) | answered Nov 24 '08, 5:34 a.m.
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.

permanent link
pugazhenthi samidurai (26423942) | answered Apr 05 '12, 5:37 a.m.
Hi


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



Thanks,

Pugazh

Your answer


Register or 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.