Building a solution to flag & comment from the issue detail view

This article is a continuation of Why flagging an issue is so cool?

Now, we are going to build a solution to emulate the functionality of adding a flag along with a comment from the issue detail view.

For doing so, we are going to use just Jira Software Cloud native features.

Please, note this solution is just a workaround to JSWCLOUD-17127 that needs to be set at the workflow level, so it is more an exercise than an actual recommendation.

Ideally, this feature will be developed by Atlassian soon, leaving this solution obsolete.

A Jira Administrator will need to configure the following elements:

  • A new screen with no fields.
  • The workflow(s) used by the issue type(s) of the project(s) where you want to have this solution.

  • An Automation Rule for adding a flag to the comment.

Create the Comment Transition Screen

Create a new screen named Comment Transition Screen.

You don't need to add any fields to this screen, since we are using it just for adding a comment during a transition.

Editing the workflow

Create a global looping transition named Add flag:

global-looping-transition.png

Set the Comment Transition Screen.

add-flag-transition.png

Now you will need to refresh the your browser to avoid finding a dead link on trying to set post-functions or conditions.

Add a condition to the transition of type Value Field:

value-field-condition.png

Set the following parameters in the condition:

value-field-condition-parameters.png

Basicly, this condition says the transition should only be available for unflagged issues.

Now, set an additional Value Field Condition, but this time with these parameters:

value-field-condition-resolution.png

In other words, the transition will only available for unresolved issues, since a completed issue cannot be blocked.

Now, add a post-function of type Update Issue Custom Field:

update-issue-custom-field.png

And set it the following parameters:

update-issue-custom-field-parameters.png

This function will add a flag to the issue.

Add a second post-function of type Update Issue Custom Field, but this time with the following parameters:

disposition-function.png

In this case, Disposition is a custom field of type Labels. You can reuse any other custom field of type Labels or even using a different type of field. We are adding a label to trigger the Automation Rule below.

Setting an Automation Rule

Finally, you just have to configure an Automation Rule this way:

automation-rule.png

This rule is triggered whenever a new comment is added to the issue.

A condition checks that the Disposition custom field contains the flag-comment label. If that is the case, the rule continues being executed. Otherwise, it stops without further effects.

The Edit issue fields action removes the flag-comment label that we added to our Disposition custom field, therefore removing the mark we used to tell this Automation Rule should be executed.

A new condition now checks that the comment being added does not already contain the flag icon. This is just a convenient thing so that if you already added the flag icon to your comment during the transition, the rule does not have to edit the comment, which produces an additional notification.

Finally, if all conditions above were met, then the flag icon will be added at the begining of the comment.

So, the solution is ready to add a flag and a comment from the issue detail view.

Ok, I have set this solution, now how do I use it?

Enter the issue detail view of an unflagged and unresolved issue that is using the workflow you configured and that belongs to a project where the Automation Rule were set.

On the top-right corner, next to the Status field, click on the Add flag button, which is the global looping transition you set in the workflow:

add-flag-button.png

The Comment Transition Screen will be shown so that you can comment why this issue is blocked:

test-comment.png

And the issue will be flagged:

flagged.png

And the comment will have a flag at the begining:

flagged-comment-transition.png

And that's all for now.

Thanks for reading!

6 comments

Mauricio Heberle
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2023

Thanks, it worked

Like Ignacio Pulgar likes this
David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 11, 2023

Thanks for your post @Ignacio Pulgar The ticket JSWCLOUD-17127 is from 2018 and this post from 2021, as of now, Atlassian hasn't provided a solution

Like Ignacio Pulgar likes this
Fawad Haq October 2, 2023

Do you know how i can display the "Add Flag" button next to the Transition options like you. Mine shows up under "Actions" only. Add-flag-1.png

Like Ignacio Pulgar likes this
Ignacio Pulgar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 13, 2023

Hi @Fawad Haq ,

Atlassian has changed it and now is no longer possible to display the button like in my screenshot.

The Actions button now contains both looping transitions from the workflow and manually triggered automation rules, when present.

I guess this provides a more uniform experience. Imagine users raising questions about a button nobody knows because it was actually created through a global looping transition...

Hope it helps.

Ignacio Pulgar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 13, 2023

By the way, if I had written this article today, I would have used an Automation Rule with a manual trigger.

Manual triggers now can be set to include user input:

Capture.PNG

A field of type Paragraph may be added to contain the comment and an Edit Issue action may add the flag.

Much simpler, right?

Artemisa Yescas January 10, 2024

hey @Ignacio Pulgar could you explain how would you do it based on your last comment please? I did the steps on the original article then try to edit the automation with your last comment but the flag icon is not added to the comment added in promt, --what we are seeing is that it appends a flag icon if we manually add a comment to the ticket after the expected input. 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events