Hi.
How would I go about getting a date from a Jira issue description (some of our issues always have the text "Effective date: 01.01.23") and set this date in a custom field "Due Date"
?
I did it like this:
First, I performed a match to check if the Description contains the string you are looking for. The smart value should be
".*Effective date: ([0-9]{0,2}.[0-9]{0,2}.[0-9]{2}).*"
Once I confirm the date string exists, I extract it and store it in the field "extractedDate" using the smart value
"{{issue.description.match(".*Effective date: ([0-9]{0,2}.[0-9]{0,2}.[0-9]{2}).*")}}"
Then, I use another "create variable" action to convert the date into the proper string (I assume it was in the form of day/month/year initially) using the smart values as follows
"20{{extractedDate.subStringAfterLast(".")}}-{{extractedDate.subStringBeforeLast(".").subStringAfter(".")}}-{{extractedDate.subStringBefore(".")}}"
Finally we set the duedate to the "convertedDate" variable we created in the step before. I confirmed this process worked on my instance! I was able to take the string
"How would I go about getting a date from a Jira issue description (some of our issues always have the text "Effective date: 01.07.23") and set this date in a custom field "Due Date"" and set the due date to July 1st 2023.
Thank you so much for this! I will try recreating this.
Have a great day!
Regards,
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Kian Stack Mumo Systems
Sadly, that didn't work.
I've modified that to
{{issue.description}} contains regex .*Effective date: ([0-9]{4})-([0-9]{2})-([0-9]{2}).*
and I get "The following issues did not match the condition" while the description has
Type of change: Intern
Type of contract: Intern
Effective date: 2023-08-28
Could you help assist us further?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.