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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Can't update 'NO ACCESS TO REQUEST' Customer's comment property

When a customer is not added to 'Request Participants' field in a issue, if the customer emails to an email notification of the issue. The reply will be added as an internal comment with the tag 'NO ACCESS TO REQUEST'.

If we want to change the comment property from internal to 'Share with Customer' with Scriptrunner script, the comment property updated successfully but the INTERNAL comment's tag still there and it doesn't share with customer.

import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.bc.issue.comment.property.CommentPropertyService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.util.json.JSONObject
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.Issue
import org.apache.log4j.Logger

def logger = Logger.getLogger("Comment property change")
final SD_PUBLIC_COMMENT = "sd.public.comment"

def commentPropertyService = ComponentAccessor.getComponent(CommentPropertyService)
def commentManager = ComponentAccessor.getCommentManager()
def issueManager = ComponentAccessor.getIssueManager()
Issue issueObject = issueManager.getIssueObject("Temp-12345")
def comment = commentManager.getLastComment(issueObject)

ApplicationUser appUser = issueObject.getReporterUser()
def authorEmail = comment.getAuthorApplicationUser().getEmailAddress()
def commentBody = comment.getBody()
def commentProperty = commentPropertyService.getProperty(appUser, comment.id, SD_PUBLIC_COMMENT).getEntityProperty()
logger.debug ("Comment Property: ${commentProperty.get()}")


if
(comment) {
def properties = [(SD_PUBLIC_COMMENT): new JSONObject(["internal", true])]
commentManager.update(comment, properties, true)
logger.debug("Update End")
}

Log output:  

Property value before updating: key=sd.public.comment,value={"internal":true}

Property value before updating : key=sd.public.comment,value={} and internal property false

 

Comment does have has the Internal tag and the comment is not available in customer portal. Do you think it is a bug?

Thank you much for your thought and help. 

1 answer

2 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 04, 2023

@Jahir H. -

Take a look at the following REST API call to obtain comment's visibility properties (Internal/Public)

https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-comments/#api-rest-api-2-issue-issueidorkey-comment-get

Keep in mind that REST API v3 is not yet available for the Data Center/Server envs.

You may want to contact Atlassian Support (https://support.atlassian.com) for further support.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

@Joseph Chung Yin Thank you for the note. I am running this script as Listeners script. 

Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 04, 2023

@Jahir H. -

If you are using JSM in your Data Center/Server envs, you should be licensed already.  You definitely can just lookup your SEN to create the support case with Atlassian Support team.

Best, Joseph

Like Jahir H. likes this

@Joseph Chung YinThank you. I submitted a ticket to Atlassian Support team. Will update you all once I have an update from them.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events