How to create multiple issues (xray test) via REST API?

David.Perez1 February 7, 2019

 Hi, 

I want to create multiple issues, this issues are of type xray tests, but i need that they have got steps. 

I've got a jira cloud and documentation of rest api is very poor. I am using next documentation 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/?_ga=2.142845757.902578191.1549535283-1503801545.1549357477#api-api-3-issue-post

my-domain/rest/api/3/issue/bulk

 

My Json is : 

{
"issueUpdates":[

{
"testtype": "Manual",
"fields":
{
"project":
{
"key": "MXTA"
},
"summary": "Testcase 1",
"issuetype":
{
"id": "10940"
}
},
"update":{
"issuelinks":[]
},
"steps": [
{
"action": "I choose the operation of the calculator Subtraction",
"data": "",
"result": "The operation must appear selected."
}
]
}
]
}

 

This Json work but the test in xray hasn't got steps.

 

I also try this json:

[ 

{
"testtype": "Manual",
"fields":
{
"project":
{
"key": "MXTA"
},
"summary": "Testcase 1",
"issuetype":
{
"id": "10940"
}
},
"update":{
"issuelinks":[]
},
"steps":
[
{
"action": "I choose the operation of the calculator Subtraction",
"data": "",
"result": "The operation must appear selected."
}
]
}
]

But i obtain next response:

{
"errorMessages": [
"Can not deserialize instance of com.atlassian.jira.rest.v2.issue.IssuesUpdateBean out of START_ARRAY token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@1cac7894; line: 1, column: 1]"
]
}

 

I don't know how to resolve this problem.

 

Thanks. David

1 answer

2 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2019

The Jira Cloud REST document doesn't have examples of this because the xray test are functionality provided by a 3rd party plugin (xray).   Instead I would recommend referring to xpand-it's own REST documentation on how to do this, check out https://confluence.xpand-it.com/display/public/XRAY/REST+API

It lists a series of different REST guides depending on what aspects of test management you are looking to do here.

David.Perez1 February 7, 2019

Thanks for answering.

I have read that documentation, but it is for jira server, I have got a jira cloud.

I think that /rest/api/3/issue/bulk is the endpoint that I must use but y have got problem with Json form to include steps in test.

I've been working on it for 3 days and I'm running out of ideas.

Thanks.

David

Matias_Reyes_Bettancourt July 14, 2020

I'm having an alike issue right now, because i have been looking through all the documentation (Xray Cloud, Xray Server and Jira Native) and there's no information about getting the information within a Testplan (Such as Tests, Executions, etc..)

As far as i know, the way of creating multiple issues is with that endpoint you posted previously ({yourAtlassianUrl}/rest/api/3/issue/bulk)

If i get any information 'bout it, i would send it to you.

I wish you good luck finding your solution.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events