Hi all, I want to get custom field value with script runner, but without mentioning any information about issue key. I am only want to mention project name. It is possible to find exactly which mentioned field are changed and have counter for it? For example I have date custom fields(D1 and D2) and I glad to know which custom field are modified and which kind of new value that receive. I write simplified script that is not cover for my project. Please help
Thanks in advance.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
IssueManager issueManager = ComponentAccessor.getIssueManager();
def issue = issueManager.getIssueObject("TEST-3");
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def changeItems = changeHistoryManager.getAllChangeItems(issue)
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10500");// here replace the ID with ID of your custom field.
def value = (String)issue.getCustomFieldValue(customField);
if(customField != null) {
issue.getCustomFieldValue(customField);
def userUtil = ComponentAccessor.getUserUtil()
def last_change = changeItems.sort(false).last()
def text1 = "LAST MODIFIED FIELD:"+ last_change["field"]+ "; FROM VALUE:"+ last_change["fromValue"] + "; TO VALUE:"+ last_change["toValue"]
return text1;
} else {
return "NO CHANGES"