Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,286
Community Members
 
Community Events
165
Community Groups

Display who the last comment (public and internal) was from

Hi there!

We want to show our agents who the last comment was from. The workflow currently looks like this:
Bildschirmfoto 2021-06-09 um 09.20.40.png

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

1 answer

1 accepted

0 votes
Answer accepted

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?

@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?

@Callum Carlile _Automation Consultants_ Cheers! It's a user picker (single user): 

Bildschirmfoto 2021-06-10 um 10.47.30.png

@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.

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

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

Thanks a lot @Callum Carlile _Automation Consultants_ ,

Will configure this and share updates...

 

Regards,

Hi @Callum Carlile _Automation Consultants_ , @Felix Hüsken

I created CustomField "Latest Comment" and have written the following component...

Image_01.png

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,

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

Coming Soon: Insight Changing to Assets

The 2020 acquisition of Mindville added powerful asset and configuration management capabilities to Jira Service Management in the form of Insight. Following the completion of that integration, custo...

257 views 1 9
Read article

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