I'm able to extract the "Review link" field as a Smart Value with `{{issue.Review links}}`
But in Slack, it ends up like this:
[https://docs.google.com/document/d/BLAH%7Chttps://docs.google.com/document/d/BLAH%7Csmart-link]
How can I get it to display like this?
https://docs.google.com/document/d/BLAH
or ideally this:
EDIT:
1. My easier ask is just to remove the surrounding square brackets, so that I can just work with the double-link directly.
2. The most ideal solution would be to extract the pure link (ie. everything from "https" until, and not including "%7" but this might be too much to ask.
So 1, would allow me to at least format it how I'd like even with a longer link than necessary.
Hi @Vin ,
Automation offers a variety of functions for working with text strings. In your case, you could use a substring function:
{{issue.Review link.substringBetween("[","%")}}
which in your example, would return
I think the other options provided as answers would generally work with URL custom fields in Jira. The link encoding you see (square brackets, the pipe "|" character represented as %7C) might be the result of using a text custom field type that allows a lot of text, and Jira is encoding the links when storing the text field. Can you, for example, save multiple links in your Review Links field, separated by normal text? Or you could double-check the field type from Jira's Custom Field administration screen.
Cheers,
Daniel | Atlassian Support
Hi Dan,
The field type is for the Review link field is` Wiki Style Renderer ` and yes, multiple links can be stored.
The substring example you provided works for multiple links. For a single link, I had to modify it to `{{issue.Review link.substringBetween("[","]")}}` for a story with a single review link.
Would there be a better solution that's designed for the Wiki style renderer that would allow extraction of single and multiple links?
Thanks,
Vineeth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try ignoring the rendering by adding .text, and then format the text the way you want to see it in Slack.
{{issue.Review link.text}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the extra field context - I think that's what's been missing. Most answers have approached this from the perspective of not using the wiki renderer (instead using the default renderer).
Kirill's answer is right - the .text function will strip out the link formatting and show only what would have been rendered as the link. From your example where the link text is the same as the link, this should work. Where this would not work is if you had custom link text like this:
[your custom link text|https://example.com]
You could avoid this being a problem going forward by switching the field to the default renderer, as it will correctly handle links and not present them to Automation as wiki markup. Switching it would expose all the previously-saved values of that field as wiki markup however - you'd probably want to go back and update all the fields if you changed the renderer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vin
I tried to send a slack message via Jira Automation and worked fine on me. For testing purposes I've used the manual trigger. When sending the message to slack, I've surrounded the smart value between <>. Try the latter.
Let me know if that works.
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doing what I've told you, you will end up with the following result (without any brackets):
This isn't what you are looking for?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the documentation:
https://api.slack.com/reference/surfaces/formatting#linking-urls
I think you need something like that:
<Review link|{{issue.Review link}}>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The issue with formatting in Slack is fine. The question is more about how to extract the link from Jira out of the brackets : [www.google.com], and preferably remove the HTML formatting too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can't open your links
can you try {{issue.Review links.Name}} or something like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.