How do you copy components from one project to another?

Deleted user April 12, 2024

We want to set up several projects with the same components, how can we do this?

5 answers

1 accepted

2 votes
Answer accepted
Kalyan Sattaluri
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.
April 12, 2024

Hello @[deleted] 

If ask is using automation, you could, using Send Web request and Advanced Branching to copy these over.

  1. Trigger = Scheduled
  2. Action - Send Web request and get components from source project
  3. Create a variable and store destination project KEY
  4. Advanced Branch over {{webResponse.body}}
  5. Action-Send Web request and create components to destination project

Repeat above steps for each project by change #3's variable for destination project. 

Havent tried doing this but seems logical, do try and let us know if issues or are stuck.

Guy Anela
Contributor
April 18, 2024

Created an Automation Rule for this today and it worked like a charm! :) Thanks, @Kalyan Sattaluri!

 Here's a screenshot of the Rule...

CopyComponentsExample.png

Here's the configuration for the For each; Advanced branching step...

CopyComponentsExample2.png

 

Anyhow, hope someone else finds this helpful. Cheers!

Thanks again, Kalyan!

Like # people like this
Kalyan Sattaluri
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.
April 18, 2024

Awesome and thanks for sharing the rule. do consider accepting answer so that your solution surfaces in google searches and others can benefit in the future. Thanks!

Chanon Borgström
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!
August 15, 2024

Hi @Kalyan Sattaluri , @Guy Anela ,

I'm trying to set up the automation and I get stuck at the get call. Have you done any special settings in the get call? It seems like the automation can't fetch anything through the API? Have experienced anything similar before?

Kind regards,

Chanon

Guy Anela
Contributor
August 16, 2024

Hi @Chanon Borgström - Are you getting any errors in the Audit Log? You'll want to make sure you have the right API endpoint URL and you have an Authorization Header defined with the proper encoded Value. Here's an example screenshot of ours...

SendWebRequestExample.png

The string that needs to be Base64 encoded should be the users email address and API Token separated by a colon (e.g. UserEmail:UserApiToken). For example... 

youruser@someemail.com:aB36g87hsdHSGd&8jhdsjnn


Here's a guide on how to encode the value using PowerShell.


Once you have the encoded value, you'll want to add it to the Headers "Value" field prefixed with the term "Basic " (as depicted in the screenshot above). Notice there's a space between "Basic" and the encoded value (e.g. Basic a2XjRXTsTXNxaWP).

I hope this helps. Cheers!

Like # people like this
Chanon Borgström
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!
August 19, 2024

Hi @Guy Anela ,

Thanks for the clarification. I missed encoding the string with the Base64 so now it works. Thank you for this!

Wishing you a great day!

Best regards,

Chanon

Like Guy Anela likes this
1 vote
emre April 16, 2024

     Hi @[deleted] 

     We have an app that provides this feature you want. 

     In the application, all components are automatically added to the Subcomponents page as content. To move these components to another project, you can press the export button and download the json file to your computer. The picture below is an image of the subcomponents page in the Configuration Management Toolkit app in one of my projects and you can do the export as in the photo.

export-components.jpg

     Then, to open a new project and import that json file, you need to click on the subcomponents page in the new project and press the import button. Then you should upload the exported file there. Then you will see this image when you load it. import screen.jpg

    Then when you press the import button, all your components will be added to the existing project and saved in Jira. 

     For more details about app: https://thestarware.atlassian.net/wiki/spaces/CBSVC/pages/2287698054/Importing+Exporting+Subcomponents 

     Application (add-on) link: https://marketplace.atlassian.com/apps/1211825/software-configuration-management-toolkit?hosting=cloud&tab=overview 

     Disclaimer: I work for the vendor who built this app.

 

0 votes
Deniz Oğuz - The Starware
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.
April 17, 2024

Hi,

You can use our Jira CLI too, AtlasCLI for Jira to copy all project components from one project to another. You can use the tool for synchronization too, because it will just skip over the existing components and continue to create missing ones.

jira project-component get-all --project=OLD_PROJECT_KEY | awk 'NR>2 {print $2}' | xargs -I {} jira project-component create --name="{}" --pKey=NEW_PROJECT_KEY

Just replace OLD_PROJECT_KEY and NEW_PROJECT_KEY with actual names of your projects. If you want, you can also override information for each component by passing other flags to "jira project-component create" command. Of course, you can also manipulate the component name and a project specific prefix/suffix if you want. To find out all the accepted parameters you can use the following command.

jira project-component create --help

 

Disclaimer: I work for the vendor who built this app.

0 votes
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2024

Hi @[deleted] 

There's a few options here...

Ste

0 votes
Victor Law
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2024

Hi @[deleted]

Jira does not support component clones natively across multiple projects.

However, it is possible to bulk-create the same set of Components via the ScriptRunner app:

 

https://library.adaptavist.com/entity/bulk-create-components-in-a-project

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events