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

IIterationTypeHandle is null ???

Hey Everyone,

We are trying to make a custom precondition to prevent saving certain workitem types on certain iteration types.

Now we run into the problem that even though our Iteration found on the workitem for sure has a defined iteration type the IiterationTypeHandle returned is null.

Our code:

			if (auditable instanceof IWorkItem) 

{

IWorkItem aWorkItem = (IWorkItem) auditable;

String workitemtype = aWorkItem.getWorkItemType();

if ( aWorkItem.getTarget()!=null)
{
IAuditable anAuditable = auditableCommon.resolveAuditable(aWorkItem.getTarget(), ItemProfile.ITERATION_DEFAULT, monitor);
IIteration anIteration = (IIteration) anAuditable;
IIterationTypeHandle anIterationTypeHandle = anIteration.getIterationType();


anIterationTypeHandle is always null anyone knows why ?

0 votes



One answer

Permanent link
Hey Everyone,

We are trying to make a custom precondition to prevent saving certain workitem types on certain iteration types.

Now we run into the problem that even though our Iteration found on the workitem for sure has a defined iteration type the IiterationTypeHandle returned is null.

Our code:

			if (auditable instanceof IWorkItem) 

{

IWorkItem aWorkItem = (IWorkItem) auditable;

String workitemtype = aWorkItem.getWorkItemType();

if ( aWorkItem.getTarget()!=null)
{
IAuditable anAuditable = auditableCommon.resolveAuditable(aWorkItem.getTarget(), ItemProfile.ITERATION_DEFAULT, monitor);
IIteration anIteration = (IIteration) anAuditable;
IIterationTypeHandle anIterationTypeHandle = anIteration.getIterationType();


anIterationTypeHandle is always null anyone knows why ?


We found the solution using the full item profile:
			if (auditable instanceof IWorkItem) 

{

IWorkItem aWorkItem = (IWorkItem) auditable;

String workitemtype = aWorkItem.getWorkItemType();

if ( aWorkItem.getTarget()!=null)
{
//IAuditable anAuditable = auditableCommon.resolveAuditable(aWorkItem.getTarget(), ItemProfile.ITERATION_DEFAULT, monitor);
IAuditable anAuditable = auditableCommon.resolveAuditable(aWorkItem.getTarget(), ItemProfile.createFullProfile(aWorkItem.getTarget().getItemType()), monitor);
IIteration anIteration = (IIteration) anAuditable;
IIterationTypeHandle anIterationTypeHandle = anIteration.getIterationType();

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

Question asked: Jul 15 '10, 8:14 a.m.

Question was seen: 4,428 times

Last updated: Jul 15 '10, 8:14 a.m.

Confirmation Cancel Confirm