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

ScriptRunner: Last shared comment on issue

Hi, 

I am using the code below but I am having a hard time finding understanding how JIRA is separating comments by internal vs shared.  Any suggestions? 

/**
* Field name: LastComment
* Template: Text Field (multi-line)
*
* Description:
* Returns the last comment on an issue.
*
*/

import com.atlassian.jira.component.ComponentAccessor

 

// get the latest comment
def commentManager = ComponentAccessor.getCommentManager()
def comment = commentManager.getLastComment(issue)

// check to see if comments exist - return comment body if so
if (comment != null) {
return comment.body
}

return null

1 answer

0 votes
Ivan Lima Community Leader Jul 20, 2021

Hi @Joseph Hortch, you can get some insights into that through the Adaptavist Library script below. Have a look.

https://library.adaptavist.com/entity/get-the-visibility-of-new-comments-in-jira-service-desk

Hi Ivan, 

Thank you.  I will take a look. 

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