Hello,
I would like to add a comment with text added to the custom field after an issue is updated. I created a Listener and wrote this script https://www.screencast.com/t/leYKRSibGr8z
The problem is: I cant get the custom field value. I tried hard, but I cant manage it. I'm using the same approach in Behaviour script and it is working well. I mean this line
def cFieldValue = underlyingIssue.getCustomFieldValue(cField).toString()
Can someone help me to get the value of the custom field?
The whole script is here:
log.warn("issue update Listener was fired")
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.plugin.webfragment.model.JiraHelper;
// Get a pointer to the current logged in user
def CurrentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().name
//log.warn("Show User:" + CurrentUser)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def CommentManager commentManager = ComponentAccessor.getCommentManager()
def cField = customFieldManager.getCustomFieldObjectByName("DB Custom 1")
//log.warn("Show cField" + cField)
def cFieldValue = underlyingIssue.getCustomFieldValue(cField).toString()
def cFieldValue =??
Thanks in advance