com.atlassian.applinks.api.ApplicationLinkService.getApplicationLinks() does not recognize the non-Atlassian application links

XMLWordPrintable

    • 9.12
    • 1
    • Severity 3 - Minor
    • Hide
      Atlassian Update – 21 January 2025

      Hi everyone,

      We would like to provide an update regarding the reported issue concerning the application links API.

      Since Jira 8.22 application links have OAuth 2.0 support, and links created with it are not visible with use of ApplicationLinkService.

      The fix adds a new ApplinkOAuth2Service API that can be used to fetch all the OAuth 2.0 configurations as application links.

      Example code:

      import com.atlassian.jira.component.ComponentAccessor
      import com.atlassian.applinks.api.oauth2.ApplinkOAuth2Service
      
      ApplinkOAuth2Service oauth2Service = ComponentAccessor.getComponent(ApplinkOAuth2Service)
      Iterable clients = oauth2Service.getApplicationLinksForOAuth2Clients()
      clients.forEach(l -> log.warn("$l.name ($l.type): $l.rpcUrl"))
      Iterable providers = oauth2Service.getApplicationLinksForOAuth2Provider()
      providers.forEach(l -> log.warn("$l.name ($l.type): $l.rpcUrl"))
      

      Dominik Wojtasik
      Senior Software Engineer, Jira Platform

      Show
      Atlassian Update – 21 January 2025 Hi everyone, We would like to provide an update regarding the reported issue concerning the application links API. Since Jira 8.22 application links have OAuth 2.0 support, and links created with it are not visible with use of ApplicationLinkService . The fix adds a new ApplinkOAuth2Service API that can be used to fetch all the OAuth 2.0 configurations as application links. Example code: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.applinks.api.oauth2.ApplinkOAuth2Service ApplinkOAuth2Service oauth2Service = ComponentAccessor.getComponent(ApplinkOAuth2Service) Iterable clients = oauth2Service.getApplicationLinksForOAuth2Clients() clients.forEach(l -> log.warn( "$l.name ($l.type): $l.rpcUrl" )) Iterable providers = oauth2Service.getApplicationLinksForOAuth2Provider() providers.forEach(l -> log.warn( "$l.name ($l.type): $l.rpcUrl" )) Dominik Wojtasik Senior Software Engineer, Jira Platform

      Issue Summary

      com.atlassian.applinks.api.ApplicationLinkService.getApplicationLinks() is not recognizing the non-Atlassian application links

      As mentioned here https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/applinks/JiraApplicationLinkService.html

      This is reproducible on the Data Center: Yes

      Steps to Reproduce

      1. Create application links from Jira to confluence(or Atlassian apps)
      2. Create application links to non-atlassian apps(Liek GitLab, Github etc)
      3. try executing a script that uses the com.atlassian.applinks.api.ApplicationLinkService.getApplicationLinks() Api to list the atlassian application links
      4. Example: executing a custom script using scriptrunner like below:
        import com.atlassian.jira.component.ComponentAccessor
        import com.onresolve.scriptrunner.runner.customisers.PluginModule
        import com.onresolve.scriptrunner.runner.customisers.WithPlugin
        import com.atlassian.applinks.api.ApplicationLinkService
        import com.atlassian.applinks.spi.link.ApplicationLinkDetails
        
        import com.atlassian.applinks.spi.link.MutatingApplicationLinkService
        
        Iterable links = ComponentAccessor.getComponent(ApplicationLinkService).getApplicationLinks()
        links.forEach( l -> log.warn("$l.name ($l.type): $l.rpcUrl"))
        
        

      Expected Results

      It should list all the application links that are present in jira

      Actual Results

      It only fetches the Atlassian links but doesn't recognize non-Atlassian application links

      Workaround

      Currently, there is no known workaround for this behavior. A workaround will be added here when available

        1. Screenshot 2024-07-26 at 2.47.20 PM_2024-07-26T09_20_13.852Z.png
          498 kB
          Devisree Gedda
        2. Screenshot 2024-07-26 at 2.47.42 PM_2024-07-26T09_20_13.852Z.png
          398 kB
          Devisree Gedda
        3. Screenshot 2024-08-13 at 3.07.10 PM.png
          403 kB
          Devisree Gedda
        4. Screenshot 2024-08-13 at 3.07.33 PM.png
          328 kB
          Devisree Gedda
        5. Screenshot 2024-08-13 at 3.12.48 PM.png
          369 kB
          Devisree Gedda
        6. Screenshot 2024-08-13 at 3.13.30 PM.png
          545 kB
          Devisree Gedda
        7. Screenshot 2024-08-13 at 3.37.56 PM.png
          406 kB
          Devisree Gedda
        8. Screenshot 2024-08-13 at 3.42.47 PM.png
          570 kB
          Devisree Gedda
        9. Screenshot 2024-08-13 at 3.42.56 PM.png
          510 kB
          Devisree Gedda

            Assignee:
            Dominik Wojtasik
            Reporter:
            Devisree Gedda
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: