Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot find matching method

Marat October 4, 2018

I'm trying to create a groovy script that will return changes in the "Due date"

import org.apache.commons.lang.StringUtils;
import com.atlassian.jira.component.ComponentAccessor;

def dateStrings = new ArrayList();

def items = ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(
issue.getIssueObject(), "duedate"
);
for (item in items) {
def from = item.getFrom();
if (from != null) {
dateStrings.add(from);
}
}
if (dateStrings.isEmpty()) return null;
StringUtils.join(dateStrings, ",");

 1231.PNGPls help)

2 answers

2 accepted

0 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2018

Hello, 

It should be :

def items = ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(
issue, "duedate"
);
0 votes
Answer accepted
Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2018

Try to use this one:

import org.apache.commons.lang.StringUtils;
import com.atlassian.jira.component.ComponentAccessor;

def dateStrings = new ArrayList();

for (item in ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(issue, "duedate")) {
def from = item.getFrom();
if (from != null) {
dateStrings.add(from);
}
}
if (dateStrings.isEmpty()) return null;
StringUtils.join(dateStrings, ",");

Suggest an answer

Log in or Sign up to answer