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

rest api link issue while creating issue

Jeremy Bertozzi September 22, 2014

Hello,

 

I'd like to link an issue to an existing one at creation using the REST API. The idea is not to CREATE then UPDATE, but just CREATE.

Here is my JSON:

 

{
    "issueUpdates": [
        {
            "fields": {
                "project": {
                    "key": "CMDB"
                },
                "issuetype": {
                    "id": "10500"
                },
                "summary": "VMP-MYSQL-01",
                "issuelinks": [
                    {
                        "type": {
                            "name": "Relates",
                            "inward": "relates to",
                            "outward": "relates to"
                        },
                        "inwardIssue": {
                            "key": "CMDB-825"
                        },
                        "outwardIssue": "CMDB-825"
                    }
                ],
                "customfield_10600": "VMP-MYSQL-01"
            }
        }
    ]
}
 
The error I get is:

 

{
    "issues": [],
    "errors": [
        {
            "status": 400,
            "elementErrors": {
                "errorMessages": [],
                "errors": {
                    "issuelinks": "Field does not support update 'issuelinks'"
                }
            },
            "failedElementNumber": 0
        }
    ]
}
Does the api support the creation of Linked Issue at creation? Using the GUI works.
 
Thanks in advance.
 
Jeremy

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Tiago Comasseto
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.
September 22, 2014

Hi Jeremy, I've tested here and got the same result. I've reviewed the create issue API documentation and could not find a clear information whether it's supported or not, but judging by the JSON response I assume that it's not supported and you'd need to make two calls, one to create the issue and another to update the issue link (/rest/api/2/issueLink)

I hope it helps.

Cheers

 

 

 

 

Jeremy Bertozzi September 22, 2014

Hi Tiago,

I wanted to avoid this workaround but I guess I won't have choice.

Thanks for your time.

Jeremy

TAGS
AUG Leaders

Atlassian Community Events