Automatic e-mail to a specific group or to many users of a report/filter query that shows all the changes needing to be implemented in a specific date for the infrastructure services platform changes. I believe having talked to Prashant, there is a plug-in add that needs to be installed to enable this capability (as an add-on it is free of charge). This will enable the team to plan and schedule each day based on implementation priorities - rather than being reactive to continual questions relating to whether changes have been implemented or not.
Hi Nikhil
I assume based on the support ticket I spoke to you on that you mean "How to send a list of Issues in an HTML formatted table via an email"
I wrote a script that can do this and I am in the process of adding to our Adaptavist script library
For now, you can view the script here.
You can use the script to work out how you can:
<This is the Jira 7 version only.>
Please try it on a test server to see how it works first
Regards
Matthew
I am facing an issue after adding custom field as below.
Script:
static String buildHTMLTableOfIssues(List<Issue> inputIssues, Boolean debug = false) {
def log = Logger.getLogger(getClass())
log.setLevel(Level.INFO)
if (debug) {
log.setLevel(Level.DEBUG)
}
// def ChangeStart = getFieldByName("Change Start Date / Time").getValue()
// def ChangeEnd = getFieldByName("Change End Date / Time").getValue()
// log.warn("No issues found with ${ChangeEnd} ${ChangeStart}")
def baseUrl = ComponentAccessor.getApplicationProperties().getString("jira.baseurl")
def writer = new StringWriter()
def html = new MarkupBuilder(writer)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def ChangeStart = customFieldManager.getCustomFieldObjects().findByName("Change Start Date / Time")
def ChangeEnd = customFieldManager.getCustomFieldObjects().findByName("Change End Date / Time")
html.html {
head {
style(type: "text/css",
'''
#myTable, th, td{
border: 1px solid black;
padding: 8px;
text-align: left;
}
#myTable {
border-collapse: collapse;
}
''')
}
body(id: 'mainBody') {
table(id: "myTable") {
tr {
th("Key")
th("Summary")
th("Status")
th("Change Start Date")
th("Change End Date")
}
inputIssues.each { issueObj ->
tr {
td {
a(href: "$baseUrl/browse/$issueObj", "${issueObj.key}")
}
td(issueObj.summary.toString())
td(issueObj.status.getName().toString())
td(issueObj..getName().toString())
td(ChangeStart ? (issueObj.getCustomFieldValue(ChangeStart).toString()) : "Invalid field1")
td(ChangeEnd ? (issueObj.getCustomFieldValue(ChangeEnd).toString()) : "Invalid field2")
}
}
}
}
}
String finalHTML = writer.toString()
log.debug("Resulting HTML=")
log.warn(finalHTML)
return finalHTML
}
Error Log:
2020-05-19 14:25:25,253 ERROR [common.UserScriptEndpoint]: ************************************************************************************* 2020-05-19 14:25:25,253 ERROR [common.UserScriptEndpoint]: Script console script failed: java.lang.ClassCastException: com.atlassian.jira.issue.IssueImpl cannot be cast to java.lang.Comparable at Script185$_buildHTMLTableOfIssues_closure2$_closure4$_closure5$_closure7$_closure8.doCall(Script185.groovy:110) at Script185$_buildHTMLTableOfIssues_closure2$_closure4$_closure5$_closure7$_closure8.doCall(Script185.groovy) at Script185$_buildHTMLTableOfIssues_closure2$_closure4$_closure5$_closure7.doCall(Script185.groovy:104) at Script185$_buildHTMLTableOfIssues_closure2$_closure4$_closure5.doCall(Script185.groovy:103) at Script185$_buildHTMLTableOfIssues_closure2$_closure4$_closure5.doCall(Script185.groovy) at Script185$_buildHTMLTableOfIssues_closure2$_closure4.doCall(Script185.groovy:95) at Script185$_buildHTMLTableOfIssues_closure2$_closure4.doCall(Script185.groovy) at Script185$_buildHTMLTableOfIssues_closure2.doCall(Script185.groovy:93) at Script185$_buildHTMLTableOfIssues_closure2.doCall(Script185.groovy) at Script185.buildHTMLTableOfIssues(Script185.groovy:76) at Script185$buildHTMLTableOfIssues.callStatic(Unknown Source) at Script185.run(Script185.groovy:48)
Can you please help me out?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil
You have too many . characters here:
td(issueObj..getName().toString())
change it to
td(issueObj.getName().toString())
Regards
Matthew
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.