Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to override CreateWorklog action in Jira?

Aitor R.P.
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 5, 2011

Hello, I'm trying to override and extend some Jira actions and I am getting an error with CreateWorklog action. The error when I try to log work in jira is:

Could not execute action [CreateWorklog!default]:Error creating bean with name 'package.ExtendedCreateWorklog':
Unsatisfied dependency expressed through constructor argument with index 3 of type [com.atlassian.jira.util.JiraDurationUtils]:
: No unique bean of type [com.atlassian.jira.util.JiraDurationUtils] is defined: Unsatisfied dependency of type [class
com.atlassian.jira.util.JiraDurationUtils]: expected at least 1 matching bean; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type
[com.atlassian.jira.util.JiraDurationUtils] is defined: Unsatisfied dependency of type [class
com.atlassian.jira.util.JiraDurationUtils]: expected at least 1 matching bean.......



The code in my atlassian-plugin.xml is:

<webwork1 key="Create-worklog-extended" name="my create worklog extension">
<actions>
<action name="package.ExtendedCreateWorklog" alias="CreateWorklog">
<view name="error">/secure/views/issue/logwork.jsp</view>
<view name="input">/secure/views/issue/logwork.jsp</view>
<view name="securitybreach">/secure/views/securitybreach.jsp</view>
</action>
</actions>
</webwork1>



My class ExtendedCreateWorklog is:

public class ExtendedCreateWorklog extends CreateWorklog
{
public ExtendedCreateWorklog(WorklogService worklogService, CommentService commentService,
ProjectRoleManager projectRoleManager, JiraDurationUtils jiraDurationUtils,
OutlookDateManager outlookDateManager) {

super(worklogService, commentService, projectRoleManager, jiraDurationUtils, outlookDateManager);
}

@Override
protected void doValidation(){

....CODE....

}

@Override
protected String doExecute() throws Exception {

....CODE....

}
}

I've found this post in the forum (http://forums.atlassian.com/message.jspa?messageID=257349347) but I don't know if this error has solution and How can I to solve it.
I've tried to put in atlassian-plugin.xml the next: "<component-import key="JiraDurationUtils" class="com.atlassian.jira.util.JiraDurationUtils"/>" , or replace in the constructor method of ExtendedCreateWorklog "jiraDurationUtils" argument by "ComponentManager.getInstance().getJiraDurationUtils()" but no result for me.

I have done something with a listener but it isn't quit right...

If anyone has some ideas for override CreateWorklog action, please help me with this. Thanks a lot!

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Jobin Kuruvilla [Adaptavist]
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.
July 14, 2013
0 votes
Nahn Yanootz
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.
May 3, 2012

It may be a "version 1 vs version 2" issue.

  1. Change your plugin to version 1 in attlassian-plugin.xml (plugins-version="1")
  2. Load the plugin jar file into [JIRA DIRECTORY]\atlassian-jira\WEB-INF\lib
  3. Since your plugin is now a version 1 plugin, it will start up with the rest of the system plugins. (every update will need a restart of the JIRA server)

I hope this works.

0 votes
Alexander Johannes
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.
August 8, 2011

ComponentManager.getInstance().getJiraDurationUtils() should work, if you are using the Atlassian SDK.

Please describe, if you are getting an error (and what) at compile or run time.

At this stage your problem description is not sufficient.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events