Groovy Script Runner - run script when the mail hanlder adding a comment

fuessldo July 14, 2013

Hi,

is it possible to run a script when the "Create a new issue or add a comment to an existing issue" mail handler add a comment to an existing issue?

Thanks,

Dominik

2 answers

1 accepted

0 votes
Answer accepted
JamieA
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.
July 15, 2013

You could try: https://jamieechlin.atlassian.net/browse/GRV-13

I don't think I got round to integrating that code.

Failing that you could add listeners, but I don't know how to distinguish events caused by mail handlers vs standard events. You could try checking transientVars and see if there is anything in there.

Globallink Techops March 19, 2015

it's a bit of a hack but i've been using this to see if an issue was created with the mail handler: if ( Thread.currentThread().getStackTrace().grep(~/com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.*/) ) { // created via mail handler } else { // created some other way }

0 votes
fuessldo July 15, 2013

Thanks, i will try https://jamieechlin.atlassian.net/browse/GRV-13

is there still a way to run a script when a comment is generally added? Regardless of where the comment is coming from ... mail handler, transition screens, ...

JamieA
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.
July 15, 2013

Suggest an answer

Log in or Sign up to answer