Project Automation - Smart Value - Issue URL in Email

Emily Lukasik
Contributor
June 23, 2020

Hello - I am setting up a Project Automation Rule to send a daily email with a list of open issues with a specific criticality.

I tried to use the format highlighted in the webinar for the other week, but I cannot get my Issue Key to be hyperlinked.

When I use the below syntax I get a blank email

{{#lookupIssues}}
* <{{url}}|{{key}}>
{{/}}

When I remove the <> and use the below syntax I get an email that bullets out the full URL | then the issue key.

{{#lookupIssues}}
* <{{url}}|{{key}}>
{{/}}

 

I am trying to get it so the Issue Key itself is hyperlinked.  Any ideas?

 

4 answers

1 accepted

6 votes
Answer accepted
Bill Sheboy
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.
June 23, 2020

Hi @Emily Lukasik 

Try this one to produce a bulleted list of the values with the key hyperlinked:

Here is the list:

<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}}</a></li>{{/}}
</ul>

Best regards,

Bill

Emily Lukasik
Contributor
June 25, 2020

Thanks Bill - that worked.  Any chance your able to explain the syntax to me; that doesn't look like anything I've seen in the help documentation (& definitely different from what they used in a Jira webinar I just watched...).  Thank you!

Bill Sheboy
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.
June 25, 2020

Certainly, and I am glad it worked for you!  

I used some HTML syntax to form the list:

  • <ul> means it is an un-ordered list.  The closing tag ends the list.
  • <li> means it is a list item.
  • <a> is used to add a hyperlink, where href is the URL reference, and the text in the middle is what to show for it...in place of the URL.  In our case, it is {{key}}
  • The rest you already figured out: how to iterate on the looked-up issues

You can search the interwebs for generic HTML documentation on building lists like this.  For example, https://www.w3schools.com/

Like # people like this
Emily Lukasik
Contributor
June 25, 2020

Thank you!

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 23, 2020

Hi @Bill Sheboy, Apologies for the reply to a closed question, but I'm looking to do a very similar thing but can't seem to replicate your solution.

I'm trying to send the issue key which is hyperlinked to the issue URL, with the automation rule's trigger being a workflow transition.

I've tried the snippet of code above, plus several other variations within the email content text box, but it returned blank in an email, do you have any suggestions?

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 23, 2020

@Bill Sheboy Never mind, I just had to remove the ul / li part and it worked! Sorry to bother you :D

Bill Sheboy
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.
September 23, 2020

Hi @Callum Carlile _Automation Consultants_ -- I am glad that worked for you.  Those HTML list markups were to help when using Lookup so you can produce a list of issues.  When you have just one item, no need for them.

__Bill

Like # people like this
Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 24, 2020

I tried copying the email text into the "Send a Slack message" action, however all of the HTML stuff is displayed as plain text... I'm wondering if it's possible to still be able to hyperlink the issue key to the URL, I don't suppose you have any experience with this have you? :)

Bill Sheboy
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.
September 24, 2020

Hi!  I do not have recent experience doing this, and I found two posts that show examples of formatting to get URLs to work.  The first is just formatting info and the second shows the full set-up process steps.

https://support.atlassian.com/jira-core-cloud/docs/use-automation-with-slack/

https://blog.codebarrel.io/how-to-use-slack-messages-with-automation-for-jira-505b4de5de1

Like Liam Harley likes this
Liam Harley
Contributor
July 31, 2021

{{issue.tourl}} works a treat.

Like # people like this
Joshua Kochelek
Contributor
October 2, 2021

Thank you @Liam Harley! Beautiful! 

Like Deleted user likes this
Raju Mandapaka
Contributor
January 21, 2022

Hi @Bill Sheboy 

Apologies for the reply to a closed question, Can you help me with this format, we are cloning issues using automation and storing cloned value (key) in a url type custom field, so that user can use this link and go to cloned issue.

I am using a smart value as {{createdissue.url) which generates a lengthy url in that custom field.

Can you help me in such a way that only cloned key should be come in that custom field.

Eg: 

{{createdIssue.url}} generates https://abc.net/browse/ATV-237

my requirement is it should generate only ATV-237 and should be hyperlinked to its URL.

Thanks,

Raju

Bill Sheboy
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.
January 21, 2022

Hi @Raju Mandapaka 

You may use the substringAfterLast() function to pull off the key from the text:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringAfterLast-String-separator-

{{createdIssue.url.substringAfterLast("/")}}

That will get just the key.  If you want to have that as a hyperlink in the field you would need to use a custom field which supports that type, and then supply both the key and url in the markup.

Kind regards,
Bill

Raju Mandapaka
Contributor
January 23, 2022

Hi @Bill Sheboy 

I Achieved first one, using a smart value {{createdissue.key}}, now i want make that output as to be converted  as hyperlink.

tried various options but failed

Option 1: -- throws error (not able save automation) 

<ul>
<li><a href="{{createdissue.url}}">{{key}}</a></li>{{/}}
</ul>

Option - : 2 --> output looks like same 

<a href="{{createdissue.url}}">{{key}}</a>

Option 3 : --> output is <a href="">ATV-251</a>

<a href="{{https://[site].atlassian.net/browse/ }}">{{createdissue.key}}</a> 

All cases are tested in both Text type, Paragraph type, url type.

Could you please guide me.

Thanks,

Raju

Bill Sheboy
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.
January 24, 2022

Hi, Raju.

Most smart values are case-sensitive, so please try this one instead:

{{createdIssue.url}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--createdIssue--

Thanks,
Bill

Like Raju Mandapaka likes this
Raju Mandapaka
Contributor
January 24, 2022

Hi @Bill Sheboy 

Can you help me with phrasing hyper link?? 

Bill Sheboy
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.
January 24, 2022

Where are you trying to place that URL? 

  • If it is in an issue field, you may just use {{createdIssue.url}}
  • If you are putting it in an email the syntax noted earlier should work:
<a href="{{createdIssue.url}}">{{createdIssue.key}}</a>
0 votes
Kunal Kumar March 30, 2023

Hey @Bill Sheboy  I have tried everything and all possible variations of your syntax but nothing seems to work. The email still returns blank with no values . Please Help !!!! 

 

Use case : For each reporter , all the issues he has created without mandatory tags a consolidated email needs to be sent with jira links of all the issues. 

Using issue.toUrl simply sends one email per issue ( ex 5 emails for 5 issues ) & #lookupIssues is also sending multiple emails with blank body 

Kunal Kumar March 30, 2023

When using the following : 

{{#lookupIssues}}

{{issue.tourl}}

{{/}} 

 

I'm getting one email per issue ( ex 3 emails for 3 issues)

Bill Sheboy
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 30, 2023

Hi @Kunal Kumar 

In general, it is a good idea to create a new question and link to older ones.  Otherwise only the people following the old threads will see them.

Next thing, please post images of your complete automation rule, showing the details of the lookup issues definition, and of the audit log details showing the rule execution.  Those will provide context and may explain the symptoms you are observing.  Thanks!

Kind regards,
Bill

Kunal Kumar March 30, 2023

@Bill Sheboy Please find the images below :

20230330_232014-min.jpg20230330_232025-min.jpg20230330_232043-min.jpg

Kunal Kumar April 2, 2023

@Bill Sheboy  can you please help

Posted the photos above .

Bill Sheboy
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.
April 3, 2023
0 votes
Hadar Dinte March 2, 2023

Hi @Bill Sheboy 

I try to add a specific URL link to my automation but it doesn't work. 

How can I add this link? 

for example: the result of the smart value {{issue.created}} will lead to www.google.com

Thank you!

Bill Sheboy
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 2, 2023

Hi @Hadar Dinte 

I do not understand your question.  Would you please explain the problem you are trying to solve?  That may provide some context for the community to offer suggestions.

For example, if you are are trying to link to a web site in an email why not just put in the exact URL, as many email formats would automatically interpret that as a linkable reference?

Kind regards,
Bill

0 votes
Matilda Dahlström
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 24, 2022

Hi!
For

<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}}</a></li>{{/}}
</ul>

I would like to also include the Summary of the issues in the hyperlink.
Is that possible?
Where should I add  {{summary}} in that case?

BR, Matilda

Bill Sheboy
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.
November 24, 2022

Hi @Matilda Dahlström -- Welcome to the Atlassian Community!

You could do that by adding {{summary}} after the key, such as with:

<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}} {{summary}}</a></li>{{/}}
</ul>

 

Kind regards,
Bill

Matilda Dahlström
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 25, 2022

Hi Bill!

Thanks. :-) 

That worked!

Again thanks, and have a nice weekend.

BR, Matilda 

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events