Hello,
Could anyone knows if it is possible to send scheduled emails with multiple lists of issues using automation rules in Jira Server?
The concern is that I am trying to get an everyday report in which I will get lists of issues with different priorities. I also need to display the issue's status, key and summary. So, what I expect to get :
Issues with High priority:
Issues with Medium priority:
...
I know how to use one JQL in one email, but I don't know how to use two of it. Maybe someone solved such kind of problems using Scriprunner's custom emails or something like that?
Hi, that’s a built in function. You don’t need any automation plugins nor administrative rights.
Hi @Florian
Thank you for your response.
Unfortunately, this method does not solve my problem because I need to see two different JQL requests which won't be mixed (as for instance when you subscribe to the filter which consists of two filters). And I also need to add some text info into the email(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Daria H_
I can confirm that what you're looking to do is currently not possible using automation rules in Jira Server. It is, however, possible to do this in Jira Cloud using the Scheduled trigger combined with the Lookup issues action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We make https://marketplace.atlassian.com/apps/1211069/notification-assistant-for-jira-email?hosting=server&tab=overview which makes this super easy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Daria H_ Hi Daria, I have ScriptRunner . You can easily do that with an escalation service. There you can execute some jql's inside the groovy code.
And send the email with the information that you need.
Im not sure how to do it without a plugin. You can get a trial license to see if its what you need.
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 response.
I have ScriptRunner and I saw this feature, but I've never used Groovy. Do you have some examples of how to use it and what should I write here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Daria H_
You can take this as an example.
It executes a jql and then iterates the results(issues).
Counts the issues with high priority .
And then sends an email. You have to configure an smtp outgoing mail server.
Hope it helps you.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.mail.Email
import com.atlassian.mail.server.SMTPMailServer
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.index.IssueIndexingService
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
SearchService searchService = ComponentAccessor.getComponent(SearchService.class)
List [] issues = null
def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService)
def queryJql = "project = test"
SearchService.ParseResult parseResult = searchService.parseQuery(user,queryJql)
def searchResult = searchService.search(user,parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
List<Issue> results = searchResult.getResults()
log.warn(searchResult.getTotal())
int count = 0;
results.each { issue ->
if(issue.getPriority().getName().equals("High")){
count++;
}
}
log.warn "High->" + count
SMTPMailServer mailServer= ComponentAccessor.getMailServerManager().getDefaultSMTPMailServer()
if(mailServer){
Email email = new Email("pobox@test.mx")
email.setFromName("Gustavo")
email.setFrom("gfelix@test.mx")
email.setSubject("Information")
email.setBody("Count: "+ count.toString())
email.setTo("pobox@test.mx")
mailServer.send(email)
}
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.