precondition: limit workitem types to iteration types
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;
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
On Wed, 07 Jul 2010 11:38:04 +0000, dk11419 wrote:
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
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