Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i disable comments in portal when the resolution is "no response"?

HAROLL JHUNIOR JAUREGUI LINARE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 17, 2023

Hi community!.

I would like to disable comments in the service desk when the the status is closed and the resolution is no response . I found some possible solutions when the status is closed but i need to keep it available for reopenings cases . 

any ideas ? 

Thanks in advance . 

1 answer

1 vote
Oday Rafeh
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.
March 17, 2023

To disable comments in the Jira Service Desk portal when the status is 'Closed' and the resolution is 'No Response,' you can use a combination of Jira's built-in features and a custom script using a scripting app like ScriptRunner for Jira.

Here's a step-by-step guide to achieve this:

  1. Install the ScriptRunner for Jira add-on if you haven't already. You can find it in the Atlassian Marketplace.
  2. Go to the Jira administration section, click on "Issues," and then select "Workflows."
  3. Identify the workflow associated with your service desk project, and click on "Edit."
  4. Click on the "Closed" status in the workflow diagram.
  5. Click on "Properties" in the right panel.
  6. Add a new property with the following details:
  7. Key: jira.permission.comment.user
    Value: denied
  8. This step will disable commenting for all users when the status is 'Closed.'
  9. Now, to enable commenting when the status is 'Closed' but the resolution is not 'No Response,' you can create a scripted condition using ScriptRunner.
  10. Go to the "Workflow" section in the Jira administration, and click on the "Script Listeners" option under the "ScriptRunner" section.
  11. Click on "Create Script Listener" and choose the "Custom Listener" option.
  12. In the "Events" field, select "Issue Commented."
  13. In the "Projects" field, choose the service desk project you're working with.
  14. In the "Condition" field, add the following script:
import com.atlassian.jira.component.ComponentAccessor

def issue = event.issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def resolutionField = customFieldManager.getCustomFieldObjectByName("resolution")

def resolutionValue = issue.getCustomFieldValue(resolutionField)

if (issue.status.name == "Closed" && resolutionValue?.name == "No Response") {
return false
}

return true

 

This script checks if the issue status is 'Closed' and if the resolution is 'No Response.' If both conditions are met, the comment event is canceled.

Save the changes to the listener.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events