Forums

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

Project Automation And Smart Values For Public comments only?

CS August 17, 2020

Hi, I am trying to edit an email template I created to include the chat history of the ticket - but am running into a bit of trouble. I hope there's some super simple fix I'm just not thinking of, but can someone direct me to the proper way to achieve my goal with Smart Values?

 

To get the conversation history, I am using

{{#issue.comments}}<img src='{{author.avatarUrls."24x24"}}' width='24px' height='24px' style='margin-top:5px'>&emsp;{{author.displayName}}: {{body}}<br>{{/}}

This snippet gets every comment on the ticket with the profile photo of the author and their name next to the body of the comment, and works great!

The problem is that this method ALSO shows Internal comments? I can't find any way to compare the conditional directly in the HTML, or only fetch public comments to begin with which would be easiest. Any tips?

1 answer

0 votes
PhilSpo
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.
August 18, 2020

can you use? {{comment.properties."sd.public.comment".internal}} I think it brings back true or false for the comment.

 

I had a similar issue for xportrt. Customers could xport the ticket and see all the internal comments.

 

I used this:

 

#{for comments}

#{if (%{!${Comments[n].Internal}})}

${Comments[n].Author}

${Comments[n].Body}

#{end}

#{end}

 

This only showed public comments.

 

You might have to play with it but it might be similar in Automation.,

 

Phil

CS August 19, 2020

Thanks Phil, I was able to come up with another solution using {{#if(conditional)}} {{/}} blocks. Surely it isn't as efficient but it works great so far, and the template has already been put into effect. 

I'm not sure this will work though, because those don't look like smart values. You're using single curly-braced values in your plugin, whereas Automation for JIRA is native and uses Smart Values that utilize a double-curly brace. Maybe i'll give it a try but I don't even think SV would support a #{for} loop.

Henning _Jira Ninja_
Contributor
April 21, 2021

Would you mind sharing a rough template of what you ended up getting to work?

I need something very similar to what you describe initially.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events