Hello,
Can someone please tell how to extract date value from the following summary field?
Employee Termination Charles Hendridge 2022-02-23
I need only 2022-02-23 , and that should be assigned to due date for further work.
Thanks,
Harish.
You can possibly do that using "Advanced Compare Condition" in Jira automation, but it will require that you use the same formatting for the date. You can pass that condition a REGEX for date matching.Regex can be quite complicated, and will require a lot of testing and ensuring the way the date is written is always the same in the summary.I might suggest instead that you set a date field (an existing one, or a custom one) up in the issue creation instead,, maybe even set it as required. It's a lot more reliable that extracting dates from the summary.
Hello Chris,
Thanks a ton for your response.
In my case, the date would be in the same format everytime.
Basically, after the extraction of date , I need to set it to a field called "due date"
And I need to check whether the issue is not closed by 2pm on the due date.
If it is not closed, I need to send a jira notification to private slack channel and to another email address.
Can you please mention the regex condition for this use case?
Also, please mention how to identify whether the issue is closed or not before 2 pm on the due date.
I'm going to *guess* that @Harish ShanmugamDhanasekar might be trying to create tickets from email, which is a pretty common thing.
If the email is computer-generated then it's *possible* to write a regex, but as @Chris Buzon correctly points out, this is definitely complicated.
For instance, here is a regex for matching dates in the format of:
dd/mm/yyyy , dd-mm-yyyy or dd.mm.yyyy
https://ihateregex.io/expr/date/
Regex is quite complicated, so I can't promise this will work.You will likely need to find a pattern that works, then test it extensively.This is what google comes up with for "regex pattern for dates"This is the explanation text I get as well: A regular expression for dates (YYYY-MM-DD) should check for 4 digits at the front of the expression, followed by a hyphen, then a two-digit month between 01 and 12, followed by another hyphen, and finally a two-digit day between 01 and 31.
/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/
Hello @Darryl Lee ,
Actually there would be certain employee termination tickets with the summary field format as Employee Termination Name of Employee yyyy-mm-dd
So, firstly here I need to extract the date field from the summary field and assign it to due date.
Later I need to check whether the employee termination ticket is closed or not before 2pm on due date.
If is is not closed then I need to send notification message to some email and also send notification to private slack channel.
Can you please let me know how to approach this goal?
Hello @Chris Buzon ,
Thanks a ton for your response
Just now I found one article according to your suggestion.
https://community.atlassian.com/t5/Automation-questions/Extract-a-date-from-summary-string-and-apply-to-Due-date/qaq-p/1838455
After we assigned a value to due date, can you please let me know how to identify whether the issue is closed or not before 2 pm of due date?
Could you not consider using an Issuetype that has the termination or hirer date as an actual date field? This is typically how you set these on-boarding off-boarding processes up.
Another (slightly simpler) example (that matches your YYYY-MM-DD format) is here:https://www.regular-expressions.info/dates.html
The trick then after obtaining that date would be to format it into something Jira understands:
Jira date format is:
2020-08-18T02:40:37.0+0000
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
So ok, maybe we can set Due Date to:
{{issue.summary.replaceAll("<strong>Employee Termination.* (19|20)","$1").</strong>replaceAll("/","-").concat("T14:00:00.0+0000")}}
Let me test this...
As for the notification if ticket is not closed before 2PM on due date, you'd need to setup an Automation that:
Thats a good idea @Jack Brickey but there is no such issue type in our organization.
Thanks for the suggestion
Understood. I'm just wondering if it could be implemented and successfully deployed. Basically, if those opening the tickets are using the portal or the application itself then it is easy to achieve success. However, if your team only creates issues via email then that is more challenging as you end up in the situation that you're currently faced with.
Basically a ticket for eg : Employee Termination Name of Employee 2022-02-09 will be created using a simple automation rule like below:
When issue is created:
if Summary contains Employee Termination keyword:
Then the issue will be automatically assigned to team lead and he gets notified via email from no-reply@automation.atlassian.com
You have a problem where two kinds of data are being stored in a single field. That's a config problem in how Jira has been used.
As others have noted, a date field would be appropriate for the date part of that.
Can you please tell how to include date field?
@Darryl Lee could you help me reserve this rule so that if I update the due date it updates the summary? https://community.atlassian.com/t5/Jira-Software-questions/Update-summary-with-updated-due-date/qaq-p/2329197
It looks like you're new here. Sign in or register to get started.