Uploaded image for project: 'Jira Software Cloud'
  1. Jira Software Cloud
  2. JSWCLOUD-21454

Parent/Sub-task relation is not displayed in the issue view on team-managed projects if the issues are imported via JSON or CSV

    XMLWordPrintable

Details

    Description

      Issue Summary

      You can import issues along with Sub-tasks via JSON with the following structure:

      {
          "links": [
              {
                  "name": "sub-task-link",
                  "sourceId": "2",
                  "destinationId": "1"
              }
          ],
          "projects": [{
                  "name" : "Bug 2 the return",
                  "key" : "B2R",
                  "description" : "description",
                  "issues": [
                      {
                          "priority" : "High",
                          "description" : "Test JSON",
                          "issueType" : "Task",
                          "summary" : "Json test",
                          "externalId" : "1"                  
                      },
                      {
                          "issueType": "Sub-task",
                          "summary" : "Sub-task Json",
                          "externalId": "2"
                      }
                  ]
              }
          ]
      }
      

      Or via CSV with the following one: Jira.csv

      Currently, although the relation seems to be created when importing those into team-managed projects, that does not reflect in the issue view:

      Steps to Reproduce

      • Import a JSON file into a Next-gen project with the structure above.

      Expected Results

      The parent/sub-task relation will be created and will reflect in the issue view.

      Actual Results

      The relation is created in the back-end, and we can see it in the issue search navigation. But that does not reflect in the issue view of the team-managed projects.

      Workaround

      I was able to create sub-tasks under an issue in a team-managed project by using the endpoint Create issue.

      Example:

      • Call:
        curl --request POST \
          --url 'https://unlimitedjiraworks.atlassian.net/rest/api/3/issue' \
          --user '<EMAIL_ADDRESS>:<API_TOKEN>' \
          --header 'Accept: application/json' \
          --header 'Content-Type: application/json' \
          --data '{
          "fields": {
            "summary": "Main order flow broken",
            "parent": {
              "key": "N1-18"
            },
            "issuetype": {
              "id": "10049"
            },
            "project": {
              "id": "10029"
            },
            "description": {
              "type": "doc",
              "version": 1,
              "content": [
                {
                  "type": "paragraph",
                  "content": [
                    {
                      "text": "Sub-task via REST API",
                      "type": "text"
                    }
                  ]
                }
              ]
            }
          }
        }'
        
      • Result:

      You can get the Id of the project by viewing it trough the endpoint Get projects paginated.

      You can get the Ids of the issue types of the project by accessing the desired issue type in the project settings, then looking at the URL:

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lalmeida@atlassian.com Leonardo De Almeida
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: