Subtask inherit Project, Sprints


I don't if what I want is possible, but I would like to create a workflow for when I create a subtask, this one inherits Project and Sprint from its parent. I would like to do it with the new online workflow javascript editor.

Any suggestion ?

Thanks in advance


Hello Antoine, you can certainly do that using our JS workflows, please go ahead and let us know if you face any issues.

Here you can find a quick start guide:


Hello Liubov,

I already had a look at the quick start guide but I didn't find a way of doing what I want. What is the event handler for issue creation, because I need to attach my workflow on that event. And How do you know if it's a subtask or not ?

Thanks a lot


Hi, Antoine!

1) Use the Issue properties: If you'd like your workflow to be triggered while you're creating an issue, use `!isReported`. If you'd like to trigger it right after creation, use `becomesReported`.

2) Check the issue `links` property to know whether it's a subtask or not.



Thanks a lot I almost came to what I want. I am know able to inherit State and Sprints from parent task, but I still can't manage to inherit project, can you give me a hint on that ?

Thanks in advance


Could you probably share your code with me?



Yeah of course,


var entities = require('@jetbrains/youtrack-scripting-api/entities');

exports.rule = entities.Issue.onChange({
title: 'Subtask inherit parent',
action: function(ctx) {
var issue = ctx.issue;

if (!issue.isReported) {
if (issue.links['subtask of'].isNotEmpty()) {
var parent = issue.links['subtask of'].first();

issue.Project = parent.Project;
issue.fields.Type = "Task";
issue.fields.State = parent.fields.State;
requirements: {
// TODO: add requirements


Hello Antoine, I'm sorry for the delay.

1) Please note that `.project` property name starts with a lower-case letter: `issue.project = parent.project;`

2) You need to fill the `requirements section` and write there required fields and values:


Please sign in to leave a comment.