Fast-track transition when comment made (Issue Commented)

Rob B
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.
November 16, 2017

I need the comment to be specific but i have no idea what the condition is meant to be? Can anyone help please as i am a beginner.

1 answer

1 accepted

3 votes
Answer accepted
Joshua Yamdogo @ Adaptavist
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.
November 16, 2017

Hi Robert,

In my fast-track transition listener, I set it up to fire on "Issue Commented" events.

For my condition, I wrote a script that gets the last comment on the issue and searches the comment for a specific email address. If the comment contains that email address, the condition will return true and the fast-track will execute the transition.

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor

def issue = event.issue as Issue
def commentManager = ComponentAccessor.getCommentManager()
def commentBody = commentManager.getLastComment(issue).getBody()
if (commentBody.contains("email@address.com")) {true}

Simply change text in the quotes to match what you want to look for.

Rob B
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.
November 17, 2017

Hi Joshua, thanks so much for your quick reply. I have set this up and it works perfectly! Thanks so much for your help :)

Joshua Yamdogo @ Adaptavist
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.
November 17, 2017

Glad to hear, Robert! Thanks for using ScriptRunner. :)

Josh

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events