Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,361,124
Community Members
 
Community Events
168
Community Groups

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!

0 comments

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,051 views 18 32
Read article

Atlassian Community Events