How to set up the "Comments" field as mandatory when changing fields such as Priority

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Purpose

Currently there's no options in JSM (Jira Service Management) to make Comments mandatory which is crucial for understanding the reasoning/context for scenarios such as when an incident ticket's priority is upgraded/downgraded.

Environment

JSM (Jira Service Management) Cloud

Solution

What will be achieved

In this example, we will focus on the following requirement:

  • user must leave a comment when modifying the Priority field

The example solution will use a combination of Transition screens, Advanced Issue Workflows & Automation to achieve the following functionality:

If a user modifies the Priority field in the Issue View, automation will revert the changes and adds a comment of the following:

Hi <USER>,

The value for Priority field has been reverted.
Please edit this field via the transition screen and add a brief comment for the change.

to the associated ticket which @mentions the user who had initiated the change. This will force users to utilize the transition in which will be configured with a screen that contains the Priority & Comment field and a Validator that only allows the issue to be transitioned if it verifies that the Comment field is not empty.

The How

Please ensure to cycle through each tab for complete instructions.
There will be an assumed level of familiarity with JSM, thus details for navigation will be minimal. 

Firstly we will need to have a screen that we can associate to a transition that at the least contains the Priority field.

  1. Navigate to Issues > Screens and either create new screen or edit an existing screen.
  2. Ensure to add the Priority field

Comment field is always available on transition screen

Lastly, you'll need to ensure that you associate this screen to the relevant transition.

  1. Open the project
  2. Go to Project Settings > Workflow
  3. Click the pencil icon to edit the relevant workflow.
  4. Select Diagram and then select the relevant transition
  5. A modal box should appear like the following
  6. Click on Edit, then select the screen that you've created/modified and Save 

This is where you will configure the Validator for a given transition. You may need to repeat these steps for other transitions if there are other statuses that would allow agents to make changes to Jira fields.

  1. Open the project
  2. Go to Project Settings > Workflow
  3. Click the pencil icon to edit the relevant workflow.
  4. Select the relevant transition and navigate to Validators tab
  5. Click Add validator and select Field Required Validator
  6. In the Fields required for this transition, select Comment
    1. Config should look something like below:

The following automation example will be relatively generic which means it will execute for a wide scope of issues. Please ensure to add further conditioning/scoping to suit your needs.

Trigger - Field value changed

Please click link for further details regarding the Field value changed trigger 

Action #1 - Edit issue

Using the following smart value:

{{fieldChange.from}}

Please click link for further details regarding the aforementioned smart value.

Action #2 - Comment on issue

Using the following syntax to @mention user:

[~accountID:{{initiator.accountID}}]

Don't forget to hit Publish and enable the rule once you've finished configuring it.

Last modified on Nov 24, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.