To require to comment issue when its state is changing by user

Hello,

The workflow I need to realize is to require a user to comment changing of issues`s state.

For example, user changes state of issue from "In progress" to "Fixed". And in this case Youtrack have to require a user to describe why he decided to fix issue at changing issue state moment in spite on is issue commented or not.

The way I found is to write:
issue.comments.required("Please, comment the reason to transit issue state");
prettyPrint();

And I got some problems of Youtrack behaviour:
1. If issue hasn`t any comments.
I change issue`s state and get command window with predetermined invalid command "comments". (screenshot attached)
2. If issue has some comments.
I change issue`s state and get nothing.

As I understand the good way for my task is next case:
Irrespective of has issue comments or not, to open command window with predetermined valid command 'comment'

How I can do it?

01.03.png


Workflow 4.2 (build #55.5851 [build on 13 Feb 2013])
YouTrack 4.1.3 (build #5764 [17-Jan-2013 15:55] )
5 comments
Comment actions Permalink
Hi Artem,

Unfortunately it's not possible yet, please vote/comment the http://youtrack.jetbrains.com/issue/JT-10337.

But you can implement the workaround:
rule Require comment on w/o verification 
 
when State.becomes({Without verification}) { 
  assert comments.added.isNotEmpty: "Please add comment in Command Window"; 
}
prettyPrint();
If you change the state by the command in the Command Window then you can add a comment in the same transaction.
0
Comment actions Permalink
Thank you, Dmitry

But you can implement the workaround:
rule Don`t close issue without comments 
 
when State.becomes({Verified}) || State.becomes({Duplicate}) || State.becomes({Won't fix}) || State.becomes({Can't Reproduce}) || State.becomes({Incomplete}) || State.becomes({Fixed}) { 
  assert comments.added.isNotEmpty: "Please comment a reason!"; 
}
prettyPrint();


Unfortunately, this rule based on your workaround doesn`t allow change state of issue anyway.
I wrote this rule in my worflow. Attach this my workflow to my project. Try change state of issue to "Fixed", Youtrack show me message "Please comment a reason!" and state isn`t changed. I comment issue and try to change state again. Youtrack show me message "Please comment a reason!" and state isn`t changed. And so on.... And I can`t change state to "Fixed" in any case! It doesn`t work (
0
Comment actions Permalink
You can only change a state and add a comment in the same transaction, it's possible only using the Command Window, you should type the command "state Fixed commment" and add comment in the "comment" textarea above:
screenshot1.png
0
Comment actions Permalink
Thanks. But it`s very poor... very poor (
This method is not suitable for us.
0

Please sign in to leave a comment.