Extract a date from summary string and apply to Due date
Asked by Thomas G:

Hi community,

I am trying to extract a date from summary and apply that date to the Due date field. I have a similar challenge as mentioned in [this post](https://community.atlassian.com/t5/Automation-questions/Take-a-date-from-a-ticket-summary-and-apply-to-Due-Date/qaq-p/1812917) but my date appears in the middle of the string and not at the end, hence making the right() function unusable here.

I thought I could use the match() function but have not succeeded.

Here is my summary: Create New User Bill Gates (NYC) on 10/30/2021 is approved

I would like to extract 10/30/2021 from this string.

I have unsuccessfully tried putting the following in an edit issue fields component: {{issue.summary.match("(\\d+\\W\\d\*\\W\\d\*)").toDate}}

Any tips much appreciated!

Best regards  
Thomas


Answers:
author: Manon Soubies-Camy
body: Hi [@Thomas G](/t5/user/viewprofilepage/user-id/3575365),

The following automation rule should meet your needs:

![rule-details.png](https://community.atlassian.com/t5/image/serverpage/image-id/165555i300483320F8CEF52/image-dimensions/198x258?v=v2 "rule-details.png")

Here are the details of the Create variable action:

![variable.png](https://community.atlassian.com/t5/image/serverpage/image-id/165556i14CF4BC418D69359/image-size/large?v=v2&px=999 "variable.png")

You can copy the smart value below:

```
{{issue.summary.match("(\d{1,4}([.\-/])\d{1,2}([.\-/])\d{1,4})")}}
```

Here are the details of the Edit issue action:

![edit.png](https://community.atlassian.com/t5/image/serverpage/image-id/165557i9D3E51DE2D0DABAE/image-size/large?v=v2&px=999 "edit.png")

You can copy the smart value below:

```
{{newDueDate.toDate("MM/dd/yyyy")}}
```

Let me know if this works on your side too!

- Manon

comments: author: Thomas G
body: Hi Manon and thank you for your swift reply. Much appreciated!!

Your solution works perfectly ?

I also tried skipping creating the variable and simply adding the date formatting (tip by you) in my original config, and that works too.

```
{{issue.summary.match("(\d+\W\d*\W\d*)").toDate("MM/dd/yyyy")}}
```

Thanks again and have a great day ahead!

Best regards  
Thomas


author: Kara Cooper
body: [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212)  
Could you help me reverse this rule so if I update the due date it will update the summary?  

<https://community.atlassian.com/t5/Jira-Software-questions/Update-summary-with-updated-due-date/qaq-p/2329197>


author: qi.ming
body: [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212)

hi Manon,

I have the same issue here that I need to parse the date from the issue summary (example:onboarding Huniya Akbar (iCC UK, 31.07.2022)) then put it to the Onboarding / Offboarding Date field we have, I had checked your solution and Thomas's too, the syntax should definitely work for me too but unfortunately it didn't, there is no value for the field after the automation has been applied. any idea why?

![re001.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207795iBEB7443FE8D8D8BF/image-size/large?v=v2&px=999 "re001.PNG")

![re002.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207796iAB14B17E9CFC5355/image-size/large?v=v2&px=999 "re002.PNG")

![re003.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207797i57DE0EF1DBF473B0/image-size/large?v=v2&px=999 "re003.PNG")

![re004.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/207798i8BC8908CDA235AE4/image-size/large?v=v2&px=999 "re004.PNG")

comments: author: Gomez, Daniel
body: you used on / off in the variable, you have to use the whole name onboarding/OffboardingDate