You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
We have tickets coming through to our Jira Service Management from another system that sends us a date value in plain text. I'd like to create an automation to scrape that value and set the due date of the ticket to that date.
So far in my automation I've created a variable called StartDate with the smart value of {{issue.description.match("Start Date:\s(.*)")}}.
In the description of the ticket I have
Start Date: 08/11/2022
For the purpose of debugging I have the automation add an internal comment to display the Smart Value which displays as 08/11/2022 which is correct but doesn't work when I try to update the Due Date to that.
In order to get that into the due date field I'm aware that I need to convert that Smart Value into an actual date that Jira understands but that is where I've got myself stuck, having tried to follow through instructions on https://confluence.atlassian.com/automation/working-with-dates-993924630.html to convert the text to a date the value is always blank and I don't know what I'm doing wrong.
Any help / guidance greatly appreciated!!
Hi Marc - Welcome to the Atlassian Community!
I would probably try to stick the value into a single line text field instead of comments since those can be one to many and harder to deal with. Then the text convert might (hopefully) will be easier.
Can you try that and see what it does? You can just use the Summary field as a test if you want. And this code then for the date field update:
{{issue.summary.toDate("yyyy MM dd")}}
Or whatever your format for dates is.
And if that doesn't work, can you share your rule along with the audit log so we can see any error messages?
Hi John, Thanks for the welcome!
Just found the time to get back to this. Thanks for you answer and apologies I didn't explain clearly that the comment is just for debugging to see what value has been scraped by the variables I've created.
The automation goes like this: First part is a variable to scrape the date out of the description.
This bit works fine and I do get exactly what I am expecting.
The next part of the automation creates another variable which I was hoping would be the date in a converted form, however, this value doesn't ever generate and the audit log doesn't show any error.
What I was wanting to do next is to take the newJoinerStartDate value created in the step above and edit the Due Date of the ticket.
This doesn't work as the value for newJoinerStartDate is blank.
The final part of the automation and the element that will be removed is to update the ticket with a comment showing me what values were created for each of the variables.
This updates my ticket to show this:
The initial value that is scraped from the ticket description is there and is correct, the problem seems to be when I try to convert that into a valid date format that the Due Date field will accept, sadly the audit log for this shows no errors which doesn't help direct me anywhere.
Any ideas / suggestions would be ace!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No ideas or suggestions, sorry - came here to say I am stuck at this point too.
Have tried multiple date formats using .toDate, .format, .jiraDate - none of which seem to work unfortunately!
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.