Creating connect dyamic modules under Connect-on-Forge breaks Jira

XMLWordPrintable

    • Minor

      Issue Summary:

      When dynamic modules are created during Connect app installation lifecycle hooks during Connect to Forge upgrade process, the existing Connect dynamic modules are not handled properly that ends up breaking page loading.

      Steps to Reproduce

      1. Create a Connect app using Spring Boot
      2. Capture the /install event with an EventListener (Controller)
        @EventListener
        public void addonInstalled(AddonInstalledEvent event){
            jiraRestCallService.callInstalled(event);
        }
        
      1. Call the Connect dynamic module API (POST /rest/atlassian-connect/1/app/module/dynamic) to create a custom field module (Service)
        public void callInstalled(AddonInstalledEvent event){
          String url = "/rest/atlassian-connect/1/app/module/dynamic";
          
          JsonNodeFactory jnf = JsonNodeFactory.instance;
          ObjectNode payload = jnf.objectNode();
          ObjectNode objects = jnf.objectNode();
          ObjectNode description = jnf.objectNode();
          ObjectNode name = jnf.objectNode();
          ArrayNode arrayNode = jnf.arrayNode();
          objects.put("key", "dynamic-custom-field");
          objects.put("type", "number");
          name.put("value", "Testing the SpringURL");
          objects.put("name", name);
          description.put("value", "This is a dynamically registered custom number field");
          objects.put("description", description);
          arrayNode.add(objects);
          payload.put("jiraIssueFields", arrayNode);
          
          ResponseEntity<String> responseEntity = atlassianHostRestClients
            .authenticatedAsAddon(event.getHost())
            .postForEntity(url, payload, String.class);
        }
        
      1. Install the app in a Jira instance.
      2. Convert the app to Connect-on-Forge with the below command:
        npx connect-to-forge@latest --type jira --url [your_descriptor_url_here]
        
      1. Register the app as a new Forge app, deploy it, and install it in the same instance where your Connect app is installed
        forge register
        forge deploy
        forge install
        
      1. All should be working fine in your Jira instance.
      2. Deploy a new forge version of your app and run forge install as well
        forge deploy
        forge install
        

        The install command might fail, as the app is already installed.

      Expected Results

      Previous dynamic modules are mapped correctly to the new Forge app modules

      Actual Results

      Page fails to load due to errors loading Connect dynamic modules

      Workaround

      App can be uninstalled to restore page loads. 

        1. screenshot-1.png
          screenshot-1.png
          252 kB
        2. screenshot-2.png
          screenshot-2.png
          315 kB

              Assignee:
              Unassigned
              Reporter:
              Hanjoo Song
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: