Setting issue start date on GANTT based on value selected
I want to manage my roadmap and show the roadmap items on a GANTT.
I have a Quarter custom field that contains the yearly quarters i.e. 2026 Q4. What I want to do is if the issue is created and a Quarter is selected the workflow must trigger and set the issue start date to the start of that quarter i.e. 1 Oct 2026. I'm OK with the java for the workflow but I do not know what field to set for the Start Date or if I can even do this.
Please sign in to leave a comment.
Hello Anton!
This setup can, indeed, be achieved with a JS workflow. The field you need to set is whatever custom date field is configured as the Start date field in your Gantt chart's advanced settings, that's what the chart reads from each issue. You can verify or change this in your chart's settings, as described in our documentation at https://www.jetbrains.com/help/youtrack/cloud/configure-gantt-chart.html#gantt-advanced-settings.
The workflow code itself would be something like this:
A couple of things to adjust for your setup:
- The name in the Quarter requirement must match your field's exact name.
- The name in the StartDate requirement must match the date field configured as the Start date field in your Gantt chart.
- The regex assumes values follow a "YYYY Q#" format, adjust it if your values look different
There is one important caveat, unfortunately: there's currently a known bug where Gantt charts don't pick up date field changes made via workflows. The field value is updated on the issue itself, but the chart won't reflect it automatically; the same change made manually works fine. You can follow progress on this at JT-68746. Please feel free to vote for it - your vote helps us measure how many customers encounter this problem and automatically subscribes you to updates. To do so, sign in to JetBrains YouTrack and click the thumbs-up icon.
Please feel free to reach out anytime if any questions arise. Have a nice day!
Thank you Stanislav Katsion , I tested and it works. Not sure if I understand the caveat correctly but I use a workflow to set my start date to the first working day of the quarter selected and this shows up just fine on my gantt
Hi Anton!
Thank you for checking. You are right, I've now tested this on the latest build, and the start date changes on the issues in the Gantt chart. Likely, the issue was fixed, but the bug wasn't updated in the tracker. I'll ask the engineering team to update the bug in the tracker.
Please don't hesitate to reach out anytime if you have any questions or need any assistance.