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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,334
Community Members
 
Community Events
185
Community Groups

Creating Projects via JSON Import

I'm trying to build a tool that will export our Redmine data and process it into a format that can then be easily imported into Jira. I've built the script for exporting the Redmine data we need and now I'm just trying to figure out the import format Jira requires. The JSON documentation is sparse and outdated, to say the least. I've worked through a few problems (like requiring undocumented `template` and `type` fields), but I cannot figure out how to create projects when importing.

I am working with a slightly modified example from the documentation:

{
"projects": [
{
"name": "Sample data",
"key": "SAM",
"type": "business",
"template": "Project management",
"issues": [
{
"key" : "SAM-123",
"status" : "To Do",
"summary" : "Parent case",
"externalId": "123"
}
]
}
]
}

When I go to Settings -> System -> External System Import -> JSON and import that file, it presents me with this error:

Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state: Unable to create project: ExternalProject{id='null', key='SAM', externalName='null', name='Sample data', type='business', template='Project management'}: Invalid module key specified:

If I change the `key` field to a project key that already exists, it imports without issue so that seems to imply that I can't use a project whose Project Key does not already exist even though the docs seem to imply otherwise (emphasis mine):

You can assign a key to both the project and the issue. These keys can be different. This example will create a project with one issue, "SAM-123".

What am I doing wrong when trying to create these projects? We intend to import between tickets to around 300 projects, so being able to automatically create these will be crucial.

2 answers

1 accepted

0 votes
Answer accepted

After a bunch of trial and error to figure out all the kinks of my import process and a lot of changes to the process, I decided against importing the projects via CSV or JSON and instead create them via the Cloud API, which is pretty well documented and features a lot of additional features the CSV and JSON importers are missing.

I recommend anyone who sees this post to skip the trying to do it via CSV or JSON and instead spend a few hours building out a script to do it via the API. You'll save time in the long run.

I still have not figured out how to create projects via the JSON importer, but I have figured out a workaround that I think I will proceed with. Basically I do a two step process:

  1. Import Projects via the CSV importer
  2. Import Issues to those Projects via JSON importer

I discovered that I can import projects very easily just using this CSV:

Name,Summary,Key,Type
Imported Project 1,Imported 2021-07-02,IP1,business
Imported Project 2,Imported 2021-07-02,IP2,business

That will create two different projects, each with an "Imported 2021-07-02" ticket that I can then do a mass search/delete for. If I then import the below JSON:

{
  "projects": [
      {
        "name": "Imported Project 1",
        "key": "IP1",
        "type": "business",
        "template": "Project management",
        "issues": [
          {
          "key" : "IP1-123",
          "status" : "Open",
          "summary" : "Parent case",
          "externalId": "43829"
        },
        {
          "key" : "IP1-456",
          "status" : "Open",
          "summary" : "Another Ticket",
          "externalId": "5239"
        }
      ]
    }
  ]
}

It correctly imports 2 tickets into the IP1 project created by the CSV importer

Cristiano
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 25, 2022

Hey @Josh Janusch, hope you are doing well!

It seems that team-managed did not work very well with JSON import. However, apart from that, if you need to perform create a company-managed project, it should work with the JSON below: 

{
    "projects":
    [
        {
            "name": "Project_name",
            "key": "PK",
            "type": "software",
            "simplified": false,
            "style": "classic"
        }
    ]
}

Can you give it a try and let me know how it goes?

Looking forward to your response. 

Cheers, 
Chris

Like ken11zer01 likes this

Hi Cristiano. This ticket is over a year old and I marked a self-response as the answer. I ran the full import back in September of last year using the API instead and it ran fine.

Cristiano
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 25, 2022

Hi Josh, 

Great! I've updated it here in order to help you and other folks that might try to find this solution. :) 

Glad to know that you were able to make this workaround!

Have a nice day!

Cheers, 

Chris

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events