You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Greetings community,
I was hoping to start a discussion regarding some custom mail handling requirements and how you all might accomplish this within your environments. I've been working for the last few weeks on automating some alerts from a third-party into Jira and I'm about done but I've run into a few snags.
Here's a basic rundown of the environment:
In Jira we have project boards for each department, so, something like
and for each of those, we have a mail address configured in Office365 with mail-routing setup to send to Jira. So each board has an e-mail address for incoming issues, like
Now, we have an external third-party vendor that we use to aggregate alerting for certain things. Essentially they're monitoring X 24/7 and if X drops below a certain threshold they fire off an e-mail to an address we've configured in their system. The e-mail has a subject line that looks like this
Up until now, it was going to a distro group where a person eventually picks it up and manually creates an issue (story) in Jira for it by just copying and pasting the contents of the e-mail.
In efforts to automate menial tasks and free up resources, we now have these going straight to Jira to create the issues directly (the third-party alerts now send to the jira- emails listed above). Then came the need to prioritize those tickets automatically, so we came up with a jython script attached to the OPEN (status) workflow for the boards that looks like
from com.atlassian.jira.component import ComponentAccessor
from com.atlassian.jira.issue import Issue
from com.atlassian.jira.config import ConstantsManager
from com.atlassian.jira.component import ComponentAccessor
summary = issue.getSummary().lower()
if "priority=p2" in summary :
priority = ComponentAccessor.getConstantsManager().getIssueConstantByName(ConstantsManager.PRIORITY_CONSTANT_TYPE, "P2")
issue.setPriorityObject(priority)
if "priority=p1" in summary :
priority = ComponentAccessor.getConstantsManager().getIssueConstantByName(ConstantsManager.PRIORITY_CONSTANT_TYPE, "P1")
issue.setPriorityObject(priority)
issue.store()
since the e-mail subject line will always have 'PRIORITY=PX' this was reasonably easy to do; in fact, I tried out the Enhanced Mail Handler add-on and it seemed to allow you to do this as well but we need some extended functionality that it did not offer. Here is where the tricky part I haven't been able to solve comes in.
As you can see, there is an OPENED and a CLOSED e-mail that get's sent in from the alerting platform. In it's current state, a separate issue is being opened for each of these whereas I'd like Jira to simply ignore the one that says CLOSED. Ideally, it would be nice if the CLOSED email triggered the closure of the issue that was created from the OPENED e-mail. In either case, I am at a loss for how to accomplish this and am hoping someone here has experience with something similar and might be able to provide some insight.