How can I use Canned Response to Close Ticket?
Asked by Georgia Stangel:

I am attempting to set up an automation so that when a specific canned response is used, it updates the request type and closes the ticket (for simple tasks like password reset links, etc) but my rule will run and do nothing. I've looked at a few other similar issues in the community but so far I've had no luck with those suggestions.

The comment from the canned response contains the exact phrase that I have the automation set to recognize so I am assuming I am missing something simple to get it to recognize it (change smart value condition, etc.)

I've tried {{comment.body}}, {{comment}}, {{issue.comment}} and also changing the rule to run for all comments added and not just the main action but no dice. I've also swapped my condition between contains, contains regular expression, and equals but that made no difference either.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327826i350E2E9986238A62/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327827i37B930D3F13323CA/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Mikael Sandberg
body: Hi [@Georgia Stangel](/t5/user/viewprofilepage/user-id/5513008),

Welcome to Atlassian Community!

I would recommend that you add a log action at the beginning of your rule to make sure that {{comment.body}} has the value you are looking for and then go from there.

comments: author: Georgia Stangel
body: Do I need to enable this somewhere in Jira Service Management? I've never used it before but and based on the Atlassian Documentation, Log Action is used with smart values but I only have the option to compare two values.

**My View**

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327833i61CF033F6A27D044/image-size/large?v=v2&px=999 "image.png")

**Log Action Example from Atlassian**

**![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327834i926E5E197325E906/image-size/large?v=v2&px=999 "image.png")**

I am very new to Jira so I'm sorry if it's a dumb question, I just keep running into things that should work in theory but won't work the way I want to set them up with Jira.


author: Mikael Sandberg
body: No, you do not have to enable it on JSM, all you have to do is add it first in your rule after the trigger component and set to something like this:

![Screenshot 2024-06-04 at 10.16.00?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/327839i7803029F266CA60F/image-dimensions/371x181?v=v2 "Screenshot 2024-06-04 at 10.16.00?AM.png")

Once your automation runs, this log action will add the data to the Audit log of the rule and you can then go a check to make sure that the {{comment.body}} has the value that you expect.


author: Georgia Stangel
body: So I do see that now, my audit log shows the exact comment that I am expecting.

I copied it verbatim from the log and put that exact phrase into my rule and I still get the response that the issue does not match the condition, but it is the exact comment I am looking for:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327855iDFFC15BF7AD78CF0/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327856iE17DA2443E239136/image-size/large?v=v2&px=999 "image.png")


author: Mikael Sandberg
body: Okay, I would consider redoing your automation and see if that helps. I just tested in my sandbox using both the {{smart values}} condition that you are using and the If/Else condition and in both cases the automation worked as expected and passes the condition. Here is what those two looks like:

Smart value condition

![Screenshot 2024-06-04 at 11.30.08?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/327857iE83D97805023EF9E/image-size/large?v=v2&px=999 "Screenshot 2024-06-04 at 11.30.08?AM.png")

If/Else condition

![Screenshot 2024-06-04 at 11.28.36?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/327858iFF8C443D4E542353/image-size/large?v=v2&px=999 "Screenshot 2024-06-04 at 11.28.36?AM.png")


author: Georgia Stangel
body: Thank you! The if/else option worked!!

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327880i98A0C469D0BEE872/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/327881i5A2D5AEB15140F48/image-size/large?v=v2&px=999 "image.png")


author: Laurie Sciutti
body: [@Mikael Sandberg](/t5/user/viewprofilepage/user-id/853579) \~ ?

![bazinga GIF](https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExMzVsM2JnanNweTVtdDc4azYwcTkzN2F5NTRtanVqbGtseGdzaHRyOCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GFLIjIaiAL0kw/giphy.gif)


Tags: cloud

jira-service-management

jira-service-management-cloud