Hi there,
I need to set some work log by script and I didn't get it working
My code:
import com.atlassian.jira.issue.worklog.WorklogImpl cus = componentManager.getJiraAuthenticationContext().getUser() wli = new WorklogImpl(null, 'JLTA-1', 0, cus.name, "work autolog", Date.parse('dd.MM.yyyy hh:mm', '13.12.2012 10:00'), null, null, 3600) ComponentManager.instance.worklogManager.create(cus, wli, 0, false)
And I receive following error:
javax.script.ScriptException: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.atlassian.jira.issue.worklog.WorklogImpl(null, java.lang.String, java.lang.Integer, java.lang.String, java.lang.String, java.util.Date, null, null, java.lang.Integer)
Please Help me, many thanks.
Jörg
Community moderators have prevented the ability to post new answers.
This is the signature:
WorklogImpl(WorklogManager worklogManager, Issue issue, Long id, String author, String comment, Date startDate, String groupLevel, Long roleLevelId, Long timeSpent)
So second arg should be an Issue, not a string. did not check further than that...
Hey Jamie,
thanks for pushing me into the right direction.
I have changed my code now to:
import com.atlassian.jira.issue.worklog.WorklogImpl import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.MutableIssue ComponentManager componentManager = ComponentManager.getInstance() MutableIssue issue = componentManager.getIssueManager().getIssueObject("JLTA-1") cus = componentManager.getJiraAuthenticationContext().getUser() wli = new WorklogImpl(null, issue, 0, cus.name, "work autolog", Date.parse('dd.MM.yyyy hh:mm', '13.12.2012 10:00'), null, null, 3600) ComponentManager.instance.worklogManager.create(cus, wli, 0, false)
And it works now.
Thanks for Helping.
Jörg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're welcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.