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

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,557,130
Community Members
 
Community Events
184
Community Groups

Scripted Mail handler without attachments

Hi All

As Jira standard mail handler can't create comments without attachments I want to use groovy scirpt for mentioned purpose (script runner). In Script Runner documentation I didn't find script which can cover my needs.

Please help to modify existing scripts mentioned in documentation to create only comments in existing issues using issue key (if possible multiple issue keys) in title and declining all types of attachments.

https://scriptrunner.adaptavist.com/5.6.13/jira/mail-handler.html

 

Thanks in advance

Regards,

Alik

1 answer

I think that will be something like this but I am not sure

import com.atlassian.jira.issue.comments.CommentManager

def subject = message.getSubject() as String

def issue = ServiceUtils.findIssueObjectInString(subject)
def body = MailUtils.getBody(message)
ApplicationUser reporter = messageUserProcessor.getAuthorFromSender(message) ?: user

if (issue) {
def comment = subject + " - " + body
commentManager.create(issue, reporter, comment, false)
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events