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

Server Side Plugin : Plugin is not called on Save operation when the Workitem state is not changed.

Hello Team,


We are implementing a server side advisor which works on Workitem save operation. It checks whether all the workitems linked using the "Tracks" link are closed or not. If not closed it doesnt allow to save the workitem.

The plugin is working as expected here but there is a second usecase where the "Workitem" shouldnt be allowed to link when the Workitem is in closed state. 

I have workitem in closed state, for which i link the new workitem which is in open state. Here the Advisor is not called at all.

What is the reason for the advisor not getting called here ?

Below is a short code snippet:
public class LinkCalculator extends AbstractService implements
            IOperationAdvisor {
      
      String selectedResolution;
      ArrayList<ParsedConfig> xmlConfiguredData=new ArrayList<ParsedConfig>();
      ArrayList<String> xmlLinkedWIList =  new ArrayList<String>();
      String newType;
      @Override
      public void run(AdvisableOperation operation,
                  IProcessConfigurationElement advisorConfiguration,
                  IAdvisorInfoCollector collector, IProgressMonitor monitor)
                  throws TeamRepositoryException {
try{
            Object data = operation.getOperationData();
            if (!(data instanceof ISaveParameter)){
                  return;
            }
            ISaveParameter saveParameter = (ISaveParameter) data;
            IAuditable auditable = saveParameter.getNewState();
            if (!(auditable instanceof IWorkItem)){
                  return;
            }
            IWorkItem workitem = (IWorkItem) saveParameter.getNewState();

Thanks in advance.

0 votes



One answer

Permanent link

This works as designed. There are different kinds of links including. 

  1. Work item links that link only work items and only work within one repository. E.g. Parent/Child
  2. OSLC links that work across multiple repositories such as Tracks/Contributes to
Links like OSLC links that can span multiple repositories do not trigger operational behavior when being changed (add or delete the link).

I tried to develop a similar extension in the past, and it is just not possible to detect the link change for these kinds of link types.

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
× 7,498
× 1,328
× 1,221

Question asked: Jul 19 '24, 2:28 a.m.

Question was seen: 455 times

Last updated: Jul 19 '24, 4:25 a.m.

Related questions
Confirmation Cancel Confirm