It's all about the answers!

Ask a question

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


Shwetha G (266711) | asked Jul 19, 2:28 a.m.

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.

One answer



permanent link
Ralph Schoon (63.6k33646) | answered Jul 19, 3:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 19, 4:25 a.m.

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.

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.