Custom subdomains not working for Teamwork Graph Smart Links

Hi, I’m currently exploring the new Teamwork Graph Smart Links module and ran into some issues and have some feedback.

1.) Custom subdomains

The most important one for me is that even if I set subdomains: true, pasting links with an additional subdomain level does not work. For example, consider the following manifest definition:

modules:
  graph:smartLink:
    - key: sl-test-example-hello-world
      icon: https://static.example-hello-world.com/favicon.ico
      name: sl-test
      function: getEntityByUrl
      domains:
        - example-hello-world.com
        - www.example-hello-world.com
      subdomains: true
      patterns:
        - https:\/\/([\w\.-]+\.)?example-hello-world\.com\/([0-9a-zA-Z]{4,128})(?:\/.*)?$

That is the example code from the documentation. This works as following when I edit an issue’s description and paste a link matching the pattern:

  • pasting https://example-hello-world.com/123456 → works :white_check_mark:
  • pasting https://www.example-hello-world.com/123456→ works :white_check_mark:
  • pasting https://us-east-1.www.example-hello-world.com/123456 → does not work :cross_mark:
    • This should work if I understand the definition of the subdomains field correctly
  • pasting https://foobar.us-east-1.www.example-hello-world.com/123456 → does not work :cross_mark:
    • I guess this is intentional but it’s not explicitly mentioned in the docs that it won’t work

I verified that the pattern should work with the given urls by testing it with regex101.com. It seems that this problem is also covered in another topic here but hasn’t been answered by anyone. Is that a known problem?

2.) id not supported

Then, it seems someone has taken @tbinna ‘s type definitions and copy/pasted them into the Smart Links tutorial but hasn’t verified them - or the API contract has changed in the meantime. I’m suspecting that because the identifier object does not accept an id field (only url is allowed) and the http request resolving the pasted url even returns an error if you provide an id in the identifier object:

[
    {
        "error": {
            "type": "ResolveFailedError",
            "message": "Invalid response received from Xen: .data.invokeExtension.response.body.entities[0].identifier id should NOT have additional properties",
            "status": 500,
            "extensionKey": "external_sl_3p::sl-test-example-hello-world"
        },
        "status": 500
    }
]

The response definition does not mention an id field either. So that should be fixed in the tutorial I guess.

3.) Using an SVG image as preview

At the top of the Smart Links documentation page, there’s a preview how a smart link will look like in the “extended” mode. On that documentation page, it’s not explicitly mentioned how we can provide/create such a preview image. But in the example code at the bottom, there’s an example hidden:

thumbnail: {
  externalUrl: 'https://...',
},

Unfortunately, if I use an SVG image there, it doesn’t display it properly and cuts off the top and bottom instead. (I tested it with an SVG image that’s being used in a Forge app with <Image /> where it is being displayed as expected) So I’m wondering what your suggestion is how we could use it?

1 Like

Hi @SebastianHesse ,

  1. In your examples the two that do not work are using the www. inbetween the sub-domain and the domain. It would need to come in as : https://us-east-1.example-hello-world.com/123456

Examples from original post.

  • pasting https://us-east-1.www.example-hello-world.com/123456 → does not work :cross_mark:

    • This should work if I understand the definition of the subdomains field correctly
  • pasting https://foobar.us-east-1.www.example-hello-world.com/123456 → does not work :cross_mark:

You are correct. The team decided to remove the id field to not confuse developers integrating. I’ve asked them to update the documentation accordingly.

1 Like

In your examples the two that do not work are using the www. inbetween the sub-domain and the domain. It would need to come in as : https://us-east-1.example-hello-world.com/123456

Actually, having “www” in between was intentional.

The question is what “subdomain” actually means here. Since you can define a domain list (including subdomains obviously), using subdomains: true sounds to me like one level deeper than each entry in the domain list defines. For example, as I’ve outlined above, for a domain list of example-hello-world.com and www.example-hello-world.com and using subdomains: true, I’d expect that urls like <subdomain>.example-hello-world.com and <subdomain>.www.example-hello-world.com are accepted. Otherwise you can only use subdomains on the same level like www , i.e. https://<subdomain>.example-hello-world.com. That is not really helpful to be honest as there are quite a few popular services (like well known cloud providers that also Atlassian uses :wink: ) who have a much more nested subdomain structure and even random subdomains in certain cases (for example if you share a link while being logged in with AWS SSO, then the domain is like <accountId>-<randomSuffix>.<region>.console.aws.amazon.com → this isn’t possible to use at the moment).

2 Likes