It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

Custom Mail Handling - Opening, Prioritizing, and Closing Issues

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

  • Marketing Board
  • Human Resources Board
  • Information Technology Board
  • et cetera

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

  • jira-marketing@company.com
  • jira-humanresources@company.com
  • jira-informationtechnology@company.com
  • et cetera

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

  • Incident 26161007 OPENED: 'Application' '[PRIORITY=P2]: Response Time (High)'
  • Incident 26161007 CLOSED: 'Application' '[PRIORITY=P2]: Response Time (High)'

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.

0 comments

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you