How to write the hyper link to get the issue key link in mail using script lis

uday May 7, 2021

Hi,

what i am asking is I have written a script Listener for automatic due notification and i have done it but the problem is i missed something in that and the notification i am like this

1. Issue key: AB

But i need the mail like this

1. Issue key: DPMZ

while clicking on the issue key it will navigate me to the issue.

regards

Uday

1 answer

0 votes
Payne
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.
May 7, 2021

I do so in a script listener like this:

//Append an issue number to this string to get a link to the request in Jira
String jiraBaseUrl = "https://myjira.com/browse/"

String body = "blah blah blah" + "<a href=\"" + jiraBaseUrl + issue.key + "\">" + issue.key + "</a>" + "blah blah blah"

sendEmail(helpDeskEmail,subject,body)

def sendEmail(String recipientEmailAddress,String subject,String body)
{
Email email
SingleMailQueueItem smqi
email = new Email(recipientEmailAddress)
email.setMimeType("text/html")
email.setSubject(subject)
email.setBody(body)
smqi = new SingleMailQueueItem(email)
ComponentAccessor.getMailQueue().addItem(smqi)
}

Hope that helps!

uday May 10, 2021

Hi payne

Thanks for the response, But there are so many issues and the mail should go all the due date who ever the assignee they will get the mail for that particular ticket so is it possible like that to create a hyper link?

Regards

Uday

Payne
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.
May 11, 2021

I don't follow what you're saying, Uday. The example I provided will make a link out of any issue number that you include in an outgoing email.

Suggest an answer

Log in or Sign up to answer