Issue State change

Hello,

I need to clone a Issue but the state should be diferent. Is possible to change the issue state?

 

BR,

0
3 comments
Official comment

Hello,

If you want to do it via workflow, then you can create your own workflow rule, which will copy the issue using ctx.issue.clone() and then change its State using issue.State field. 

Here are the links: https://www.jetbrains.com/help/youtrack/standalone/Workflow-Tutorial.html, https://www.jetbrains.com/help/youtrack/standalone/v1-Issue.html#copy.

Please find the examples here: https://www.jetbrains.com/help/youtrack/standalone/Default-Workflows.html

Hope it helps.

Avatar
Permanently deleted user

Hello,

 

The problem is how the State assign are done. I need to use a State defined by me. 

How could I do the issue state attribution?

issue.State =  ???  (the state is a custom state ReadyToStart)

 

 

Regards,

0

You need to define State field in requirements section and also specify ReadyToStart value there like this:

requirements: {
State: {
type: entities.State.fieldType,
Open: {
name: "Open"
},
ReadyToStart: {
name: "ReadyToStart"
}
}
}

 

After that, you'll be able to use this state like ctx.State.ReadyToStart. So you can change the State like issue.State = ctx.State.ReadyToStart.

1

Please sign in to leave a comment.