Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scripted Mailhandler that creates CF from email body

dD
Contributor
February 8, 2022

Dear community,

I hope I you can help me with this.

I need a Mailhandler that does the same as the standard Create a new issue or add a comment to an existing issue. But with the difference, that I want to read the information from the mail body, into the custom fields of the issue.

e.g. when I write following mail:

Subject: (DEM-10) Demo Titel

Body:  CF1: value1

           CF2: value2

           CFX. valueX

Then scriptrunner should automatically create a new ticket with this information.


Is there like a standard framework to do so? Like a code-script I can copy+paste and adapt to my settings? This would be really great, as I am not use to writing codes :)

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2022

Yep, feel free to use https://library.adaptavist.com/search?term=handler to find some sample scripts for email handlers - they should get you started.  First couple of hits were about parsing data into fields already!

Chris S. July 15, 2022

I see in your link "Create a New Issue Using a Mail Handler script and Set the Assignee to the First Valid CC User" ....

I have a use case where the mail sender doesn't know who the assignee should be, and therefore the newly created issue should have the assignee set to either 'project lead', if the project lead is the default assignee, or if the default assignee is 'unassigned', then the assignee should be set to 'unassigned'.

However, it seems the native Jira functionality of 'default assignee' is bypassed when using ScriptRunner as a mail handler.

Any suggestions?

thanks,

Suggest an answer

Log in or Sign up to answer