JETI: Initializing Due Date Field Question

Doug Pflueger February 21, 2018

I'm attempting to initialize the due date field from the body of an email.  I've got the following set up:

1. In the handler, "Initialize Issue Fields" is checked.

2. In the "Fields" section, Goal of Rule is set to "Set fields in NEW issues..." 

3. My regular expression: (?i)(?<=due date:)\s*((0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20))\d\d is working in the JETI regex tester.  For example, "due date: 02/21/2018" would extract "02/21/2018".

4. I've tried both matching in the email body, and grabbing capture group 1, and setting manually using $parser.parseDate("MM/dd/yyyy", $group1).

5. And lastly, my issue field is "Due Date".  

What am I missing?  Thanks in advance.

 

1 answer

0 votes
Attila Bódis March 1, 2018

Hi Doug!

Have you tried this?

"How to initialize Date and DateTime picker fields

if you want to set Date or DateTime picker fields, date or date time values from the email must be parsed. Email This Issue provides an object that supports date parsing.

E.g. say your regexp returns the date string in the first capture group: 23/07/2015. Then set the Use Value From attribute to Manual and enter $parser.parseDate("dd/MM/yyyy", $group1).

The date or date time pattern follows the syntax in Java SimpleDateFormat."

 

source: https://metainf.atlassian.net/wiki/spaces/PLUG/pages/66093130/Field+Contexts#FieldContexts-HowtoinitializeDateandDateTimepickerfields

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events