Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,028
Community Members
 
Community Events
165
Community Groups

Create a specific request type ticket based on an email and parse field

Hi there,

First off, sorry for the wordy subject :)

The ITSM solution we currently use has a mail monitor built into it that takes emails and breaks parses out various elements into variables that we can use to create specific tickets.

For example we have structured our system generated alerts to have particular words in the subject to steer the info to a ticket type and we have delimiters in the Body of the email to be able to pull out words, dates, information

i.e. we can derive the host name due to having based on a rule that says within the body of the email After Hostname: and before <<end Host name it will start the value.

We are getting emails for off boarding from our HR system and through our scim connector we can totally format the email.

I want to be able to capture things like the user name, their account name, end date, notes that are all formatted in the email to be parsed out.  I am just not sure who to plug all this in to JSM to be able to catch the email, pull out variables and then to create the 'Staff Movements' ticket we have as a standard request type.

Thanks.

1 answer

1 accepted

1 vote
Answer accepted

You can configure an incoming mail server for Jira, and then create mail handlers to process them. 

What you want should be possible with Script Runner's mail handler. You get access to "message" parameter which is a javax.mail.Message object of the email received. Then you can parse the message however you like, and create an Issue with it. 

ok thanks, will have to have a look and see how to break down the email using the mail handler with Script Runner, haven't touched it before.

Thanks for the pointer, I'll now go into the darkness and see what I come out with :D

Script Runner allows you to specify a Groovy script, and provides a list of certain parameters... you can see the parameters if you click on the question mark icon at the lower right corner of the script editor. 

Since the mail handler gives you the javax.mail.Message object, you have access to the email data you want. 

And then you can use ComponentAccessor.getIssueManager().createIssue to create the issue. 

Thanks heaps, I just don't know enough about script runner to put all this together yet but it obviously will do what I need it to do.

Will try and find some dummies guides with examples / templates hopefully where I can plug in some variables and see this in action.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

235 views 0 6
Join discussion

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