Table Transformer - Extract URL

Madhu Sagar March 5, 2024

Hi,

In the Epic JIRA description field I have a URL between 2 delimiters. How can I extract the URL using the Table transformer SQL, while maintaining the HTML hyperlink formatting.

Thanks!

1 answer

4 votes
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 5, 2024

Hi @Madhu Sagar ,

Please can you share what do you exactly see in your cell and how do you want your result cell to be seen after the transformation?

There is a possibility to extract the URL or its part from the hyperlink (https://community.atlassian.com/t5/Confluence-Cloud-questions/Table-Transformer-extracting-URL-from-Jira-Results/qaq-p/2581858) and then we can try, for example, to create a new clickable link using this URL.  

Madhu Sagar March 5, 2024

So lets say Description field of Epic 1234 in JIRA has this content -

 

https://community.atlassian.com is an important website

 

Using Table Transformer, I want Confluence to display below table. The links are of varying length of course. 

 

Epic ID   Link

1234     https://community.atlassian.com

 

 

Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 6, 2024

Hi @Madhu Sagar ,

Thank you for the clarification! 

Hope this workaround will help your case:

Wed 8-1.png

SELECT *,
MATCH_REGEXP(T1.'Description'->getView(), "href=\"(.*?)\"")->1 AS 'Optional column', /* Delete this line, it is used just to show that we extract links as text */
FORMATWIKI("[Link|" + MATCH_REGEXP(T1.'Description'->getView(), "href=\"(.*?)\"")->1 + "]")
AS 'Link from the Description'
FROM T*

Wed 8-2.png

 

Like Dmitry Prokudin likes this
Adam Petrie October 1, 2024

Could someone please explain what this part of the query is doing for a newbie?

 T1.'Description'->getView()

Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2024

The getView() is one of the JavaScript methods - several JavaScript functions were introduced along with the AlaSQL library for advanced cases (like this one where we need to grab not the beautiful link text but the hidden link itself) https://docs.stiltsoft.com/tfac/cloud/general-syntax-and-sql-functions-available-42246251.html#GeneralsyntaxandSQLfunctionsavailable-JavaScriptmethods

Like Adam Petrie likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events