Automatically add an issue to a Sprint based on a custom date field
I am attempting to see if there is a way to utilize a custom date field as the indicator to queue adding an issue to a Sprint. I currently have Sprints set up for each month and I would like to have an issue where if the custom date field ("ETA to QA" for example) falls in the current Sprint timeframes that it is automatically added to the Sprint for the month.
Is there any way to do this?
Thanks!
Please sign in to leave a comment.
Hello Ken, I can recommend you to approach this task with the use of our scheduled workflow rules:
https://www.jetbrains.com/help/youtrack/incloud/2017.2/Workflow-Rules.html#Scheduled
https://www.jetbrains.com/help/youtrack/incloud/2017.2/Quick-Start-Guide-Workflows-JS.html#d109236e325
Please let us know if you face any challenges along the way, we'll be happy to answer any questions.
Thanks for the assistance! I guess my next question would be am I able to utilize the new WF structure alongside the old WF structure or do we need to first convert our existing workflows over to the new structure before I can add this in the new format?
Also, since I am still learning JavaScript, how would I go about field to be equal to "This Month"? Below is the sample for On-schedule rules from the link you provided:
if (issue.fields.DD < Date.now()) {
Would I need to change this to:
if (issue.fields.DD < Date.thismonth()) {
Or would that be incorrect?
Hello Ken, I'm sorry for the delay.
Yes, you'll be able to use old workflows along with the new ones, there's no need to convert all old workflows into the new scheme at once.
Now to your question:
To get the current month, you can create a new variable:
var curMonth = new Date().getMonth();
Here's the thread on how to get a human-readable month: https://stackoverflow.com/questions/1643320/get-month-name-from-date