Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to reference the last public service desk comment with smart-value fields

First the use case: I am trying to create an automation that adds a comment after a help desk issue has been waiting on a customer 13 days and then closes it after 14 days if they don't reply.

I have the structure of the rule created and working for the timing. However I am having trouble with the comment to tell a user their issue will be closed in 24 hours. Because most of our users will see the comment in their email and not click through to view the issue's history I want to have the previous comment that is awaiting their reply in the 24 hours notice comment body. I was going to just use the {{issue.comment.last.body}} smart value, but if the last comment was an internal comment that has information the user/customer shouldn't see, that smart value doesn't filter it and will share it with the customer. So I have been perusing the documentation trying to figure out how I might achieve getting the last public comment instead of just the last comment.

Thus far the only thing I can think of is some if else branches that use the {{comment.getfromend(0).internal}} to test each comment with a compare condition. But no issue will have the same amount of comments and I don't see a way to loop through them in a rule for testing, I do see it for displaying all comments. But perhaps I'm just missing the option or a built in property/smart value I can use to achieve this.

3 answers

1 accepted

2 votes
Answer accepted

Hi JJ,

 

In order to do this you can utilise another rule to store the last user comment as a property of the issue.

Create a rule like:

  • Issue commented
  • Compare condition that checks if the comment is not internal {{comment.internal}} should Equal false
  • Set Entity property
    • Select issue
    • use the key - lastCustomerComment
    • then store the comment body - {{comment.body}}

 

The when sending your email you can reference {{issue.properties.lastCustomerComment}}

 

Hope that helps.

 

Cheers,
Nick [Automation for Jira]
Co-founder

That makes some sense.

I will give that a try

Sorry for the delay in response, it was a busy January. Finally got a minute to try it. It looks like it will work, but since my automation is meant for closing a customer ticket that has been open for 7 days (commenting at 6 days) it's a bit hard to test. So I'm going to mark this as the answer and return if there are problems. I'm betting there won't be problems.

So it turns out this isn't working. I figured out I was doing a compare that could never equal so I looked through the documentation and found what looked like a better call under isAfter date functions.

So for example I setup the rule like this (along with a rule for storing the lastPublicCommentDate as the example was given). It keeps saying that a date such as 

{"key":"lastPublicCommentDate","value":"2019-05-22T10:44:25.2-0600"}

is not returning true for being after now minus 3 business days (which I believe should be either 5/27 or 5/24 depending on whether or not that function recognizes holidays automatically, I'm guessin it doesn't) And in either case that date is after 5/22.

I also tried messing with the format of the date and using the toDate function to make sure things were actually dates.

I can't seem to get it to ever evaluate to true. What am I doing wrong?Capture.PNG

Like EBM Becky likes this

Got an answer in a support ticket with code barrel.

Had to add '.toDate' to my lastPublicCommentDate entity property.

Something that helped a lot was adding a log action before my if/else branch like this one

Property as date: {{issue.properties.lastPublicCommentDate.toDate}} Eval: {{now.minusBusinessDays(3).isAfter(issue.properties.lastPublicCommentDate.toDate)}}

Like # people like this

I'm writing a Automation Rule wherein I want to copy the External/Public/Customer comment made by the agent on all the linked cases.

 

I've tried this {{triggerIssue.comment.last.body}} but it copies the comment as internal note. How can I copy it to the "Reply to Customer" section

The compare condition that checks if the comment is not internal {{comment.internal}} should Equal false is quite useful for us. However I tried to manage that only the last public comment will be sent either via email or web hook but during my tests with email none the following did work. Am I doing something wrong?

{{issue.properties.lastPublicCommentDate.toDate}}

{{comment.properties."sd.public.comment".internal}}

 

 

Thanks,

Johannes

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you