---
ai:
  exclude: true
search:
  tags:
    - issueLink
    - POST
seo:
  description: >-
    Creates an issue link between two issues. Reference for the POST
    /api/2/issueLink endpoint in the Jira Software Data Center REST API
    Reference.
sidebar:
  label: Create an issue link between two issues
  badge: POST
title: Create an issue link between two issues
type: openapi-operation
---
Creates an issue link between two issues.

`POST /api/2/issueLink`

**Request body** (`application/json`, required)

All information about the link relationship. Which issues to link, which issue link type to use and an optional comment that will be added to the first issue.

- `comment` (CommentJsonBean)
- `inwardIssue` (IssueRefJsonBean)
- `outwardIssue` (IssueRefJsonBean)
- `type` (IssueLinkTypeJsonBean)

Request body example:

```json
{
  "comment": {
    "author": {
      "active": true,
      "avatarUrls": "http://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10000",
      "displayName": "Fred F. User",
      "emailAddress": "fred@example.com",
      "key": "fred",
      "name": "Fred",
      "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
      "timeZone": "Australia/Sydney"
    },
    "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
    "created": "2012-07-06T18:30:00.000+0000",
    "id": "10000",
    "properties": [
      {
        "key": "issue.support",
        "value": "{\"hipchat.room.id\":\"support-123\",\"support.time\":\"1m\"}"
      }
    ],
    "renderedBody": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
    "self": "http://www.example.com/jira/rest/api/2/issue/10010/comment/10000",
    "updateAuthor": {
      "active": true,
      "avatarUrls": "http://www.example.com/jira/secure/projectavatar?size=xsmall&pid=10000",
      "displayName": "Fred F. User",
      "emailAddress": "fred@example.com",
      "key": "fred",
      "name": "Fred",
      "self": "http://www.example.com/jira/rest/api/2/user?username=fred",
      "timeZone": "Australia/Sydney"
    },
    "updated": "2012-07-06T18:30:00.000+0000",
    "visibility": {
      "type": "group",
      "value": "jira-software-users"
    }
  },
  "inwardIssue": {
    "fields": {
      "issuetype": {
        "avatarId": 10002,
        "description": "A problem which impairs or prevents the functions of the product.",
        "iconUrl": "http://www.example.com/jira/images/icons/issuetypes/bug.png",
        "id": "1",
        "name": "Bug",
        "self": "http://www.example.com/jira/rest/api/2/issuetype/1",
        "subtask": false
      },
      "priority": {
        "description": "This is a description of the priority",
        "iconUrl": "http://www.example.com/jira/images/icons/priorities/major.png",
        "id": "1",
        "name": "Major",
        "self": "http://www.example.com/jira/rest/api/2/priority/1",
        "statusColor": "red"
      },
      "status": {
        "description": "The issue is currently being worked on.",
        "iconUrl": "http://localhost:8090/jira/images/icons/progress.gif",
        "id": "10000",
        "name": "In Progress",
        "self": "http://localhost:8090/jira/rest/api/2.0/status/10000",
        "statusCategory": {
          "colorName": "blue-gray",
          "id": 1,
          "key": "new",
          "name": "To Do",
          "self": "http://localhost:8090/jira/rest/api/2.0/statuscategory/1"
        },
        "statusColor": "green"
      },
      "summary": "string"
    },
    "id": "10000",
    "key": "HSP-1",
    "self": "http://www.example.com/jira/rest/api/2/issue/10000"
  },
  "outwardIssue": {
    "fields": {
      "issuetype": {
        "avatarId": 10002,
        "description": "A problem which impairs or prevents the functions of the product.",
        "iconUrl": "http://www.example.com/jira/images/icons/issuetypes/bug.png",
        "id": "1",
        "name": "Bug",
        "self": "http://www.example.com/jira/rest/api/2/issuetype/1",
        "subtask": false
      },
      "priority": {
        "description": "This is a description of the priority",
        "iconUrl": "http://www.example.com/jira/images/icons/priorities/major.png",
        "id": "1",
        "name": "Major",
        "self": "http://www.example.com/jira/rest/api/2/priority/1",
        "statusColor": "red"
      },
      "status": {
        "description": "The issue is currently being worked on.",
        "iconUrl": "http://localhost:8090/jira/images/icons/progress.gif",
        "id": "10000",
        "name": "In Progress",
        "self": "http://localhost:8090/jira/rest/api/2.0/status/10000",
        "statusCategory": {
          "colorName": "blue-gray",
          "id": 1,
          "key": "new",
          "name": "To Do",
          "self": "http://localhost:8090/jira/rest/api/2.0/statuscategory/1"
        },
        "statusColor": "green"
      },
      "summary": "string"
    },
    "id": "10000",
    "key": "HSP-1",
    "self": "http://www.example.com/jira/rest/api/2/issue/10000"
  },
  "type": {
    "id": "10000",
    "inward": "is duplicated by",
    "name": "Duplicate",
    "outward": "duplicates",
    "self": "http://www.example.com/jira/rest/api/2/issueLinkType/10000"
  }
}
```

**Responses**

- `201` — Returned if the issue link was created successfully.
- `400` — Returned if it can't create the supplied comment.
- `401` — Returned if the user does not have the link issue permission for the issue, which will be linked to another issue.
- `404` — Returned if issue linking is disabled or it failed to find one of the issues (issue might exist, but it is not visible for this user) or it failed to find the specified issue link type.
- `500` — Returned if an error occurred when creating the issue link or the comment.
