# Uploading Planning Data

## Upload Example Using cURL

In the following, we provide an example of how to push your Planning data to Logilica for storage and built-in analytics. The following depicts all possible fields that can be included in an upload of a ticket or issue, both the mandatory and optional fields.

The cURL POST command is below. Note, that the POST command includes the example API token `lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb` and the example workspace `myworkspace`. The command URL also includes a placeholder for the projectID to associate the uploaded issues with. This projectID is obtained from the `pm/projects/create` endpoint.

```
curl --location --request POST \
'https://logilica.io/api/import/v1/pm/<projectID>/issues/create' \
--header 'X-lgca-token: lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb' \
--header 'x-lgca-domain: myworkspace' \
--header 'Content-Type: application/json' \
--data-raw '[{
    "id": "ABC-123",
    "origin": "JIRA",
    "createdAt": 1689207410,
    "updatedAt": 1689309835,
    "creator": {
        "name": "John Doe",
        "email": "john.doe@myorganisation.com",
        "accountId": "johnDoe",
        "lastActivity": 1701436893
    },
    "reporter": {
        "name": "Jane Doe",
        "email": "jane.doe@myorganisation.com",
        "accountId": "janeDoe",
        "lastActivity": 1699536093
    },
    "assignedAt": 1689207463,
    "assignee": {
        "name": "Sally Smith",
        "email": "sally.smith@myorganisation.com",
        "accountId": "sallySmith",
        "lastActivity": 1701091293
    },
    "inProgressAt": 1689207487,
    "resolvedAt": 1689309835,
    "resolver": {
        "name": "Sally Smith",
        "email": "sally.smith@myorganisation.com",
        "accountId": "sallySmith",
        "lastActivity": 1701436893
    },
    "resolution": "Fix",
    "type": "Task",
    "status": "Completed",
    "statusCategory": "Done",
    "summary": "Revive user API endpoints in each service.",
    "description": "Go into each service and enable the API endpoints that both upload and import user data.",
    "url": "https://myworkspacename.atlassian.net/browse/ABC-123",
    "labels": ["backend"],
    "sprintKeys": ["456"],
    "priority": "Low",
    "storyPointEstimate": 1,
    "parentIssue": "ABC-789",
    "events": [
        {
            "type": "PM_ISSUE_CREATED",
            "author": {
                "name": "John Doe",
                "email": "john.doe@myorganisation.com",
                "accountId": "johnDoe",
                "lastActivity": 1701436893
            },
            "createdAt": 1689207410,
            "to": ""
        },
        {
            "type": "PM_ISSUE_ASSIGNED",
            "author": {
                "name": "John Doe",
                "email": "john.doe@myorganisation.com",
                "accountId": "johnDoe",
                "lastActivity": 1701436893
            },
            "createdAt": 1689207463,
            "to": {
                "name": "Sally Smith",
                "email": "sally.smith@myorganisation.com",
                "accountId": "sallySmith",
                "lastActivity": 1701091293
            }
        },
        {
            "type": "PM_ISSUE_IN_PROGRESS",
            "author": {
               "name": "Sally Smith",
                "email": "sally.smith@myorganisation.com",
                "accountId": "sallySmith",
                "lastActivity": 1701091293
            },
            "createdAt": 1689207487,
            "from": "To Do",
            "to": "In Progress"
        },
        {
            "type": "PM_ISSUE_RESOLVED",
            "author": {
               "name": "Sally Smith",
                "email": "sally.smith@myorganisation.com",
                "accountId": "sallySmith",
                "lastActivity": 1701091293
            },
            "createdAt": 1689309835,
            "from": "In Progress",
            "to": "Done"
        }
    ]
}]'
```

## Method of Importing Planning Data

To ensure the accuracy of data in Logilica, planning data should be imported in the following order:

1. Create a project and fetch the ID returned to you. You use this ID in subsequent calls to the Logilica Import API for Planning Data.
2. Import or update sprints
3. Import or update issues

Data is displayed in Logilica once issues have been imported.

## API Schema for Importing Planning Data

### Create a new project

{% openapi src="/files/H2K3YSOSvLkeTJqrV3HE" path="pm/projects/create" method="post" %}
[openapi.json](https://3637178088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvMP8keAdyp2axoLILtL5%2Fuploads%2Fgit-blob-d8a87b720df94b60e4756c4b7d2c1bfce151c6a1%2Fopenapi.json?alt=media)
{% endopenapi %}

### Add or Update Sprints

{% openapi src="/files/H2K3YSOSvLkeTJqrV3HE" path="pm/{projectID}/sprints" method="post" %}
[openapi.json](https://3637178088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvMP8keAdyp2axoLILtL5%2Fuploads%2Fgit-blob-d8a87b720df94b60e4756c4b7d2c1bfce151c6a1%2Fopenapi.json?alt=media)
{% endopenapi %}

### Add or Update Issues

{% openapi src="/files/H2K3YSOSvLkeTJqrV3HE" path="pm/{projectID}/issues/create" method="post" %}
[openapi.json](https://3637178088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvMP8keAdyp2axoLILtL5%2Fuploads%2Fgit-blob-d8a87b720df94b60e4756c4b7d2c1bfce151c6a1%2Fopenapi.json?alt=media)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.logilica.com/advanced/import/uploading-planning-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
