Evgeniy Kuznetsov
Evgeniy Kuznetsov

Reputation: 59

No signature of method / Atlassian Jira / Groovy

I'm trying to get DueDate and add a several days to it:

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue
Date duedate = issue.getDueDate().plus(30);
MutableIssue.setDueDate(duedate.toTimestamp());

And then, I get the following error:

groovy.lang.MissingMethodException: No signature of method: static com.atlassian.jira.issue.MutableIssue.setDueDate() is applicable for argument types: (java.sql.Timestamp) values: [2018-08-31 00:00:00.0]
at Script311.run(Script311.groovy:5)

I have tried different solutions, but none works. How to fix it?

Upvotes: 1

Views: 430

Answers (1)

Daniel
Daniel

Reputation: 3370

You can't call .setDueDate(...) on the MutableIssue class itself; it's not a static method. You need to call setDueDate(...) on an instance of the class. Assuming issue is a MutableIssue instance (in your code it's not obvious where it's coming from) you should be able to just call issue.setDueDate(duedate.toTimestamp());

Upvotes: 1

Related Questions