Hi Folks,
I try to implement a create issue and update listener. My code works fine as long as I use a hard coded issue key. I have tried all day long to find out how to retrieve the current issue key in listener context.
This is my code
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.event.issue.DelegatingJiraIssueEvent;
import com.atlassian.jira.event.issue.IssueEvent;
import com.atlassian.jira.event.issue.IssueEventBundle;
import com.atlassian.jira.event.type.EventType;
import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.sql.Sql
import java.sql.Driver
def log = Logger.getLogger("com.acme.CreateSubtask")
log.setLevel(Level.DEBUG)
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_13800");// here replace the ID with ID of your custom field.
def issueManager = ComponentAccessor.getIssueManager()
// here is my problem
def issue = issueManager.getIssueObject("ANFO-331")
//
def value = issue.getCustomFieldValue(customField);
log.warn value
Any suggestions how to solve the problem? Thanks in advance.
Peter
Issue issue = event.getIssue()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Payne,
I want to retrieve the issue key and update the issue key value in custom field. i am adding script in Behaviour. But i am getting error. Could you please help on this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.