Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-12118

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 3.7.3
    • Java API

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              59812918a3b5 A F
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: