Missed Team ’24? Catch up on announcements here.

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

Is it possible to add a custom bulk operation?

Alex Moquia July 17, 2014

I am working in JIRA 6.0.7. I would like to develop a plug-in that would show up as a bulk operation available for issue navigator search results? Is there a specific module I need to choose to accomplish this? Thanks!

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
John Bishop
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 31, 2014

Here's the steps I had to take to implement bulk operations in Jira 6.2.4.

  1. Create a class that extends AbstractBulkOperation
  2. Create a class that extends IssueActionSupport
  3. Create a webworks action that extends the class you made in step 2. This action needs at least details and perform commands.
  4. Create all the necessary vm templates for the webworks action.
  5. Create a class that implements the BulkOperationManager. You add your custom bulk operations in the constructor of this class.
  6. Define everything in the atlassian-plugin.xml.

Detailed instructions for all these steps could take pages, and unfortunately I don't have the time for that. So let us know if you have any specific questions about them.

Valentin Borlea October 14, 2014

Hi, I just started to implement a plugin for adding a new operation in "Bulk Change". Your steps are very useful, but I have two requests: 1. Can you please describe what is needed to define in atlassian-plugin.xml? (an example would be very useful). 2. Where is the linkage between the created operation and the webwork done? Thank you very much!

Mikhail_Kopylov
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.
November 18, 2014

Hi, @Valentin Borlea. You have to define: 1. <component> module with AbstractBulkOperation inheritor class 2. <webwork1> module with action to call bulkoperation methods.

0 votes
Robert Varga August 26, 2015

Let me extend the answer above with my findings:

  1. I extended AbstractBulkOperation class and used approach with EventListener to add this class in afterPropertiesSet like this:
    ComponentAccessor.getBulkOperationManager().addBulkOperation(MyOperationClass.NAME_KEY, MyOperationClass.class);
  2. I exteded AbstractBulkOperationDetailsAction, but BulkEditBeanSessionHelper couldn't be autowired so I introduced protected constructor and got it there:

    protected MyActionClass()
    {
    super(null, ComponentManager.getComponentInstanceOfType(BulkEditBeanSessionHelper.class));

    genericBulkWatchOperation = ComponentAccessor.getBulkOperationManager().getOperation(NAME_KEY);
    }

     

  3. I created Webwork element in atlassian-plugin.xml, something like this:
    <webwork1 key="key" name="name" class="java.lang.Object">
    <actions>
    <action name="path to action class" alias="Action">
    <command name="details" alias="ActionDetails">
    <view name="success">/secure/views/bulkedit/bulkchooseoperation.jsp</view>
    <view name="input">/secure/views/bulkedit/bulkActiondetails.jsp</view>
    <view name="error">/secure/views/bulkedit/bulkchooseoperation.jsp</view>
    </command>
    <command name="detailsValidation" alias="ActionDetailsValidation">
    <view name="input">/secure/views/bulkedit/bulkActionconfirmation.jsp</view>
    <view name="error">/secure/views/bulkedit/bulkActionconfirmation.jsp</view>
    </command>
    <command name="perform" alias="ActionPerform">
    <view name="error">/secure/views/bulkedit/bulkActionerror.jsp</view>
    </command>
    </action>
    </actions>
    </webwork1>

    JSP files cannot be embedded in plugin, I deployed them to /secure/views/bulkedit

  4. no need to create custom BulkOperationManager
  5. to wrap it up - you need 3 classes (Operation, Action and EventListener), webwork definition in atlassian-plugin.xml and event listener definition also in atlassian-plugin.xml. Then you need JSP files. You can take existing ones and use them as an example.

Basically I took WatchIssue operation files and did it analogically. Lot of research behind this one but it finally worked. If you have any answers feel free to ask.

 

TAGS
AUG Leaders

Atlassian Community Events