"Error in creating test run. Reason : {priority=Priority is required.}"

susee_jeeva September 22, 2018

Currently, i am planning to import test results in JIRA through REST API. But, what is the expected json format for cucumber/json or any other.

Because when i try to import i am getting the following error "Error in creating test run. Reason : {priority=Priority is required.}". 

I could not find the expected format anywhere. Please help me providing a sample format which will successfully creates test run using REST API

3 answers

1 accepted

0 votes
Answer accepted
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2018
susee_jeeva September 23, 2018

Hi @Mohamed Benziane,

 

The link which you have shared is for JIRA Server. But we are using JIRA Cloud so the localhost:8080 will not work for us. Could you please share documentation to create issues in JIRA Cloud.

 

Waiting for your reply

 

Thanks,

Susee

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 23, 2018

Hi @susee_jeeva

You can take a look at this page:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/

Try this to know all metadata required to create an issue in JIRA.

Regards

susee_jeeva September 24, 2018

Hi @Mohamed Benziane,

 

This is what i needed. Thank you so much. By using these REST APIs i am able to create my own issues.

Regards,

Susee

1 vote
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2018

Hi @susee_jeeva

Look at your create screen,the priority fields is maybe required. If so you can make it optionnal or add the priority and its value in your json

Regards

susee_jeeva September 22, 2018

Hi @Mohamed Benziane,

Thanks for the reply. But, i am not creating test run manually. I need the test run to be created using REST API

So, it requires,

apiKey -> which i have provided

format -> which i have provided as cucumber/json

file -> for which i need a expected json structure.

 

Currently, i am using the following json in my test.json file, in which i have no confident

{
"priority": "high",
"info" :
{
"project": "QCMP",
"priority": "high",
"summary": "Ready",
"description": "Krytoi test"
},

"tests" : [
{
"priority": "high",
"testKey" : "QCMP-37",
"start" : "2016-04-21T14:00:00+01:00",
"finish" : "2016-04-23T16:47:35+03:00",
"comment" : "https://www.google.by/",
"status" : "PASS"
}
]
}

 

So, i think i need a sample json, which i will provide in the file parameter, so that i can create the test run with test cases.

I am using postman to access REST API

 

Please, let me know your thoughts.

 

Thanks,

Susee

0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2018

Hi @susee_jeeva

Even if you are note creating manually,if the field priority is mandatory in the create screen in jira you have to put it on yor json file, make sure the value allowed is exactly the same that you have on your json.

 

Regards.

susee_jeeva September 22, 2018

Hi @Mohamed Benziane,

Please find the updated test.json content below.

{
"priority": "P3-Medium",
"info" :
{
"project": "QCMP",
"priority": "P3-Medium",
"summary": "Ready",
"description": "Krytoi test"
},

"tests" : [
{
"priority": "P3-Medium",
"testKey" : "QCMP-37",
"start" : "2016-04-21T14:00:00+01:00",
"finish" : "2016-04-23T16:47:35+03:00",
"comment" : "https://www.google.by/",
"status" : "PASS"
}
]
}

 

As you can notice, i have provided the priority as P3-Medium and this value is allowed in my JIRA.

But, the problem is, i am not sure of the json structure which i am using. So, i have provided the priority property in all objects available in the above json.

 

So, if an expected sample json structure is available, i can update my existing json's structure.

So, all i need is, i need to create a test run through REST API.

Please provide your valuable thoughts.

Suggest an answer

Log in or Sign up to answer