Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

get the issue key of the current issue Edited


I have created a custom listener script below ( and this is my first time doing that ) that assigns the issue ( created / edited ) to certain user based on certain custom field value but I got an issue :

1- I need the script to run on the current issue instead of putting its key manually in getIssueByCurrentKey I have tried to use  issue.getKey() but faced the error below :

groovy.lang.MissingMethodException: No signature of method: static com.atlassian.jira.issue.MutableIssue.getKey() is applicable for argument types: () values: [] Possible solutions: getAt(java.lang.String), notify(), every(), grep(), grep(java.lang.Object), every(groovy.lang.Closure) at



I have solved the problem as I said in my reply to the first comment.

here is the new working code  :

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import org.apache.log4j.Logger
import org.apache.log4j.Level
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.IssueInputParametersImpl
import com.atlassian.jira.event.issue.IssueEvent
def logg = Logger.getLogger("com.acme.CreateSubtask")
String user;
def cfManager = ComponentAccessor.getCustomFieldManager();
def cf = cfManager.getCustomFieldObject("customfield_32946");
def cfVal = issue.getCustomFieldValue(cf)
def userr = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
switch(cfVal as String){
case { it == "[Assistant, Ask to Google]" || it == "[Assistant, Request to Google]" || it == "[Assistant, VF Office Hours]" }:
user = "";
logg.debug issue
def issueService = ComponentAccessor.issueService
def issueInputParameters = new IssueInputParametersImpl()
def updateValidationResult = issueService.validateUpdate(userr,, issueInputParameters)
issueService.update(userr, updateValidationResult, EventDispatchOption.ISSUE_UPDATED, false)


2 answers

1 accepted

1 vote
Answer accepted

I have solved this problem.  It was a misunderstanding from my side, I just needed to use issue to get the issue key as shown in the updated code :


logg.debug issue

Hi! you need to do something similar to this


import org.apache.log4j.Category
import org.apache.log4j.Logger
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.bc.issue.IssueService;
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser;

class ExampleListener extends AbstractIssueEventListener{
void workflowEvent(IssueEvent event){
def log = Logger.getLogger("ExampleListener.groovy")

//Issue issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("BO-2940"); //Line for testing
Issue issue = event.issue;
IssueService issueService = ComponentAccessor.getIssueService();
JiraAuthenticationContext authContext = ComponentAccessor.getJiraAuthenticationContext();
ApplicationUser user = authContext.getLoggedInUser();

//Rest of your code

Hi @Juan Manuel Ibarra

Thank you! I have solved this part.  It was a misunderstanding from my side, I just needed to use issue to get the issue key.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Bitbucket Smart Commits vs. Genius Commits - What's the difference?

If you already heard about Smart Commits in Bitbucket, know that you just stumbled upon something even better (and smarter!): Genius Commits by Better DevOps Automation for Jira Data Center (+ Server...

114 views 0 2
Read article

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