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

Replace CCC plugin with script runner

I use CCC last comment plugin, is there any way that i can replace this plugin with scripted field from script runner.

Thanks

1 answer

1 accepted

0 votes
Answer accepted

From memory, a scripted field that does something like

def allComments = CommentManager.getComment(issue)

gets you a list of all the comments.  What I can't remember is how it is sorted, but if it is by Id of the comments, then just grabbing the last element from it (as lastcomment) should get the comment, then you can say

return lastcomment.getBody()

To put the text into a scripted field.  You might also want to add lastComment.getAuthroFullName() and lastComment.getCreated(). (And have a think about looking at the last user to amend it instead of original author)

Can you please attach link or which can explain me briefly.

Thanks,

SAI 

You should create a new custom field of type "scripted field", then go into Admin -> Scriptrunner -> scripted fields, and add a script to it. 

That script should

  1. use CommentManager to get the comments from the issue
  2. Work out which one is last
  3. Return the body of the comment, along with any other data you want from it (author and last edited?)

Can i get the script?

Thanks Nic Brough, i tried your steps and i successfully get the latest comment using script runner.

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