The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How to copy a agile board using Java API?

Antonio Dionisio
Contributor
November 6, 2017

I am developing an add-on (Jira 7.5+) that can create project based on the customer actions. The project is created using a template but it happens that the project can be a software project so I have to create a board based that project too. While it is possible to create a board programatically I can not find a way to copy  a existing board including the configuration. Moreover as far as I know there is no way to configure a given board using Java API.

I am aware that it does exist a REST API that does what I am asking for but since the add-on will run on the server side I am not able to make an authenticated REST call without storing somewhere an user and password for it.

Thanks.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Antonio Dionisio
Contributor
November 8, 2017

I managed to copy a agile board doing this:

First adding greenhopper dependency to my add-on pom.xml:

<dependency>
          <groupId>com.atlassian.jira.plugins</groupId>
          <artifactId>jira-greenhopper-plugin</artifactId>
          <version>7.4.0</version>
          <scope>provided</scope>
      </dependency>

Next I have to get the RapidBoardService within my class:

RapidViewService rapidViewService = (RapidViewService) ComponentAccessor.getOSGiComponentInstanceOfType(RapidViewService.class);

RapidViewService has a method for fully copying a rapidview:

rapidViewService.copy(user, board)
Nikola Sandalski
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!
March 18, 2018

Hello @Antonio Dionisio, which JIRA version do you use?

0 votes
Yusuf TAMBAĞ
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!
December 23, 2019

Hi,

 

I recently needed to use Agile components within my Jira plugin and I realized that they are not defined as components but beans. So, following code worked for me to obtain rapidview service and rapid view manager. beanFactory is of type (org.springframework.beans.factory.ListableBeanFactory) and you can inject it through constructor as usual:

 public MyAction(@ComponentImport final ListableBeanFactory beanFactory) {

 

 

Map<String,RapidViewService> rapidViewServiceMap=beanFactory.getBeansOfType(RapidViewService.class);
Map<String,RapidViewManager> rapidViewManagerMap=beanFactory.getBeansOfType(RapidViewManager.class);
if(rapidViewServiceMap==null || rapidViewServiceMap.size()==0)
LOGGER.error("Unable to obtain rapid view service!!!");
else
this.rapidViewService = rapidViewServiceMap.get(rapidViewServiceMap.keySet().iterator().next());
if(rapidViewManagerMap!=null && rapidViewManagerMap.size()==0)
LOGGER.error("Unable to obtain rapid view manager!!");
else
this.rapidViewManager =rapidViewManagerMap.get(rapidViewManagerMap.keySet().iterator().next());

  

0 votes
Anton Chemlev - Toolstrek -
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 Champions.
November 7, 2017

Have you already explored this - https://docs.atlassian.com/jira-software/6.7.12/ ?

For example, package com.pyxis.greenhopper.jira.boards

h
November 7, 2017

<dependency>
<groupId>com.atlassian.jira.plugin</groupId>
<artifactId>jira-greenhopper-api</artifactId>
<version>6.7.12</version>
</dependency>

ithis is my code ,but it's not work

what should i do?

h
November 25, 2017

i have the same problem with you ,i add the code to pom.xml,certainty l failed.

Nic Brough -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 Champions.
November 25, 2017

You'll need to describe your problem better than "it failed".