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.PNG Pls 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
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events