I have a rule that when the value for Sprint is changed (which is typically when an issue is added to a sprint) to edit issue fields Start date and End date (both are Date Picker fields) with Sprint start and end:
{
"fields": {
"Start date": "{{sprint.startDate}}",
"End date": "{{sprint.endDate}}"
}
}
also tried sprint.startDate.JiraDate but get same error:
(The Start date must be of the format "yyyy-MM-dd" (customfield_11502), The End date must be of the format "yyyy-MM-dd" (customfield_11582))
Please assist, have searched community and this seemed to be the way, but it doesn't work.
Hello @Paula Manildi
We will be better able to help you if you provide us with screen images showing all the components of your rule. Sometimes problems are due to the current context where you are using the smart values, and we can't determine context without seeing the entire rule.
Additionally you can try using the Log action to print the values of those smart values into the rule Audit Log, to check if the information matches your expectation.
If the Sprint Start Date and End Date are actually date + time values then you will need to use a format function to convert it to just a date and properly formatted for adding to the issue Start Date and End Date fields.
If you opted to take my advice to use the Log action to print out the smart values you are trying to use you would see that the actual value for a Sprint Start Date field is in this format:
That field content does not match the input format required for the Start Date field.
You will need to use a format function to convert it to just a date and properly formatted for adding to the issue Start Date and End Date fields.
Is your trigger set up to be triggered for any change to the Sprint field, or only when values are added? Have you considered what will happen if an issue is removed from a sprint, or added to a future/planned sprint that doesn't yet have any dates set?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can see the format is wrong. I don't know now to fix. That is what I needed help with, to get the right function.
And I don't see how log action helps since it doesn't show an example.
I find the documentation woefully unhelpful.
I have, however, changed the function to:
{
"fields": {
"Start date": "{{sprint.startDate.jiraDate}}",
"End date": "{{sprint.endDate.jiraDate}}"
}
}
which seems to work Obviously worth the months I've spent with this based on the (as previously stated) unhelpful Atlassian documentation on this subject.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am glad you were able to figure out the correct formatting command.
I find the Log action to be helpful because it shows exactly what information we are trying to place into the Start Date and End Date fields when you reference {{sprint.startDate}} and {{sprint.endDate}}. That proves to me that the smart values are actually date/time information (confirming we are referencing useful fields with the right type of information).
When you tried to use .JiraDate and got the same error message, I concede that the message itself does not explicitly say that you have not supplied a valid format function name. You could have used the Log function to print out {{sprint.startDate.JiraDate}} to see exactly what the "JiraDate" function was doing (or not doing) to format the data.
I can't really refute or address your consideration that the documentation is not helpful. It seems pretty straight forward to me looking at the Jira smart values - date and time page how to use the formatting functions and which one matches the format specified in the error message. Given that the format function names use upper and lower case I would infer that it is important to use the exact same case when trying to use the keyword.
At the bottom of most Atlassian documents is a method to provide feedback.
I encourage you to use those options to give Atlassian feedback on how they can improve the information.
And I would definitely encourage you to come to the Community sooner when you are having trouble finding a solution. Struggling for months to figure out a problem is understandably frustrating.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.