Set Component/Fix Version in post function does not set a component or version

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Low
    • None
    • Affects Version/s: 3.7.3
    • Component/s: Java API
    • 3.07

      SetComponentAndVersion.java
      public class SetComponentAndVersion implements FunctionProvider
      {
          /**
           * Automatically assign subtasks the same component/version as parent task.
           */
          public void execute (Map transientVars, Map args, PropertySet ps)
              throws WorkflowException
          {
              MutableIssue task = (MutableIssue)transientVars.get("issue");
              
              if (task.isSubTask())
              {
                  ComponentManager componentManager = ComponentManager.getInstance();
                  IssueManager issueManager = componentManager.getIssueManager();
                  MutableIssue parent = issueManager.getIssueObject(task.getParentId());
                  
                  task.setComponents(parent.getComponents());
                  task.setFixVersions(parent.getFixVersions());
                  task.store();
              }
          }
      }
      

      Fairly simple and straight forward. I have access to the components and versions from the parent task, but they are not set successfully on the child task.

            Assignee:
            Unassigned
            Reporter:
            A F
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: