Hi there!
We want to show our agents who the last comment was from. The workflow currently looks like this:
Both edits work (as in the automation does not fail), but only the first field "Last Comment" is populated. What do we need to do populate "Last comment from" with the author of the comment?
Cheers for your help,
Felix
Hi @Felix Hüsken , welcome to the Community!
You can use a smart value of {{issue.comments.last.body}} to show the last commend added, and then {{issue.comments.last.author.displayName}} to display the name of the user who left this last comment.
Hope this helps!
Thanks a lot Callum!
{{issue.comments.last.author.displayName}} unfortunately produces an error for both public and internal comments: (Specify a valid value for customfield_10193 (customfield_10193))
Do you have an idea why?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Felix Hüsken So that means that either the smart value isn't returning any value and the Edit issues action is failing, or the value returned somehow isn't being set.
What is the field type of customfield_10193? E.g. text field, user picker etc?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Felix Hüsken Ahh okay, for setting the user picker field try using the smart value of {{issue.comments.last.author.emailAddress}} - the user picker fields act slightly differently to text fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Callum Carlile _Automation Consultants_ ,
I understand
{{issue.comments.last.body}} will return / populate the comment text,
issue.comments.last.author.displayName will return / populate the author name (the author can be an agent or a customer) (I should preferably use a text field instead of a user-picker, right?)
Can you please suggest a keyword to fetch the date when the last (latest) comment was added?
Regards,
Ashraf B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ashraf B
You can amend the above smart value to something like
{{issue.comments.last.created.jiraDate}}
Which willl display the date in the format of
2022-01-25.
Using this list of date manipulations, you can replace the jiraDate bit with other things to display different formats of date and time. So for example:
{{issue.comments.last.created.jiraDate}} displays 11/1/79 6:23 AM
{{issue.comments.last.created.mediumDate}} displays Nov 1, 1979
{{issue.comments.last.created.mediumDateTime}} displays Nov 1, 1979 6:23:12 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot @Callum Carlile _Automation Consultants_ ,
Will configure this and share updates...
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Callum Carlile _Automation Consultants_ , @Felix Hüsken,
I created CustomField "Latest Comment" and have written the following component...
I also created a CustomField "Latest Comment On" with "Last public comment date" type, but this field doesn't appear in rule configuration...
Also, I created a CustomField "Latest Comment By" with "User picker (single user)" but couldn't set the dynamic SmartValue that you suggested, i.e. issue.comments.last.author.displayName OR{{issue.comments.last.author.emailAddress}}
Can you check and respond and also share the steps / screenshots if possible...
Thanks a lot,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Callum Carlile _Automation Consultants_ Your suggestions really helped.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.