Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,049
Community Members
 
Community Events
184
Community Groups

Scriptrunner email post-function issue URL

Edited
Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 03, 2020

Hi

I want to send an email using Scriptrunner Email Post Function. The email needs to contain the URL of the issue.

Is there a built in method to do this?

or do I have to form the link manually with Base URL / project code etc.

https://blah.com/browse/CSD-14300

 

1 answer

1 accepted

0 votes
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 03, 2020

Hi @Tom Lister 

Issues don't have an "url" attribute. If you think about it, it would not be a good idea to store that in the db because the baseUrl and the application context could change.

So yeah, making a URL out of the baseURL and issue key is the only way to go as far as I know.

def baseUrl = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)
def link = """<a href=
\"${baseUrl}/browse/${issue.key}\">${issue.key}</a>"""
Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 04, 2020

Hi @Peter-Dave Sheehan 

There are some built in methods for email template e.g. this provides a list of workflow actions in the email.

${getWorkflowButtons.call()}

I was hoping for something similar for other utility functions. Is there a list of available functions.? No sign in the ScriptRunner documentation.

My next issue is how to stop the code snippet showing up in the email from the template as raw text.

And finding the right syntax for displaying the variable value.

I think I can try putting the code into the condition section.

Tom

Capture.JPGCapture1.JPG

Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 04, 2020

PS

this embedded syntax works for me

Capture2.JPG

Like Rolf Lader likes this
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 04, 2020

Probably a matter of preference, but I like to keep the template simple and put the more complex stuff in the condition where you get better syntax checking.

 

2020-02-04 09_33_20-Listeners.png

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events