It's all about the answers!

Ask a question

precondition: limit workitem types to iteration types


Kim Soederhamn (1.5k34348) | asked Jul 07 '10, 7:29 a.m.
Hey Everyone,

We are trying to create a precondition to limit the type of workitems that can be planned against iterations with a certain iteration type - for instance to keep tasks away from a product backlog or making plan only with a custom workitem type.

now this precondition should be activated on the save workitem and should be created as an advisor but I dont know how to extract the iteration type and the workitem type from the IWorkItem I guess its stored in the getTarget() but I dont know how to handle this.

My sample code :

public class ExampleOperationAdvisor implements IOperationAdvisor {

public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration,
IAdvisorInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {

Object data = operation.getOperationData();
if (data instanceof ISaveParameter) {
ISaveParameter saveParameter = (ISaveParameter) data;
IAuditableCommon auditableCommon= saveParameter.getSaveOperationParameter().getAuditableCommon();
IWorkItemCommon workItemCommon= auditableCommon.getPeer(IWorkItemCommon.class);
IAuditable auditable = saveParameter.getNewState();


if (auditable instanceof IWorkItem)
{

IWorkItem workItem = (IWorkItem) auditable;

One answer



permanent link
Jared Burns (4.5k29) | answered Jul 08 '10, 12:52 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Wed, 07 Jul 2010 11:38:04 +0000, dk11419 wrote:

We are trying to create a precondition to limit the type of workitems
that can be planned against iterations with a certain iteration type -
for instance to keep tasks away from a product backlog or making plan
only with a custom workitem type.

I can't help with the Work Item API, but I'm wondering if you've tried to
achieve this behavior simply using permissions? Since you can configure
the permissions differently for each iteration type, it would be possible
to only grant permissions to create workitems of a particular type within
a particular iteration type.

- Jared
---------------------
Jazz Team Process

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.