Auto Transition based on commenters

Hi,
I'm asking about issue status auto transition based on commenters

i.e. if the assignee replied to issue "or one from assignees group" the issue status should be waiting for customer response

Thanks

3 answers

Hi,

You can use script runner's "Fast-track transition an issue" listener by selecting Issue Commented Event and writing Additional Conditions

You can find further info on https://jamieechlin.atlassian.net/wiki/display/GRV/Listeners

0 vote
Bryan Trummer Community Champion Apr 15, 2014

So you are wanting the issue to move to waiting for customer response depending on who the commenter is?

import com.opensymphony.workflow.WorkflowContext

import com.atlassian.jira.issue.Issue

import com.atlassian.jira.ComponentManager

import com.atlassian.jira.event.issue.AbstractIssueEventListener

import com.atlassian.jira.event.issue.IssueEvent

import org.apache.log4j.Logger

import static org.apache.log4j.Level.DEBUG

import com.atlassian.jira.bc.issue.IssueService.UpdateValidationResult

import com.atlassian.jira.bc.issue.IssueService.IssueResult

import com.atlassian.jira.bc.issue.IssueService

import com.atlassian.jira.bc.issue.IssueService.TransitionValidationResult

import com.atlassian.jira.issue.IssueInputParametersImpl

import com.atlassian.jira.issue.IssueInputParameters

import com.atlassian.jira.util.ErrorCollection

import com.atlassian.jira.issue.index.IssueIndexManager

class invoketransition extends AbstractIssueEventListener {

Logger log = Logger.getLogger(invoketransition.class)

@Override

void issueUpdated (IssueEvent event) {

//add your code to get the user who has commentted, assignee and all usernames from assignment group and add the condition

Issue issue = event.getIssue();

def issuestatus = issue.getStatusObject().getName().toUpperCase()

actionid = 123 //action id for transition to reach to status waiting for customer

ComponentManager componentManager = ComponentManager.getInstance()

IssueService issueService = ComponentManager.getInstance().getIssueService()

IssueInputParameters issueInputParameters = issueService.newIssueInputParameters()

TransitionValidationResult validationResult = issueService.validateTransition(user, issue.id, actionid, issueInputParameters)

issueService.transition(user, validationResult)

}

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Amir Kazemi
Posted 4 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

21 views 0 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you