Workflow to require a comment when setting an issue as resolved

Hi there,

in our project, I would like to have a workflow which requires the user to make a comment when setting the issue as resolved. So, when the user changes the state, it should automatically open a comment field telling the user something like “Please leave a comment on how the issue was resolved”.

Is there a workflow for this available, I am not a coder myself. Jira had this solution: https://confluence.atlassian.com/jirakb/how-to-add-a-comment-during-a-workflow-transition-and-make-it-mandatory-779160682.html

Maybe someone has already a code for this?

Thanks for help,

Jan

0
2 comments

Hello Jan E. 

Here is an example of such a workflow:

guard: (ctx) => {
   return ctx.issue.becomesResolved && ctx.issue.is(ctx.Assignee, ctx.currentUser);
 },
 action(ctx) {
   const hasLastCommentByAssignee = ctx.issue.is(ctx.Assignee, ctx.issue.comments.last()?.author);
   workflow.check(hasLastCommentByAssignee, 'You must add a comment to close the issue!');
 },

It checks whether the last comment is made by the current user (who is an Asignee as well), and if not - asks to add a comment.

 

0

great, just saw this -thanks so much. Will look into it!

0

Please sign in to leave a comment.