Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error while creating the test cases using rest APIs

Siva Barri July 26, 2023

While I am trying to create test cases using Rest APIs, I am getting errors.

End Point -  https://<Jira Server>/rest/api/2/issue/

Payload -

 

{
"fields": {
"project": {
"key": "PROJECT_KEY"
},
"parent": {
"key": "STORY_KEY"
},
"summary": "Test case summary",
"description": "Test case description",
"issuetype": {
"name": "Test"
}
}
}
Erorr:
{
    "errorMessages": [],
    "errors": {
        "issuetype""Issue type 10300 is not a sub-task but a parent is specified."
    }
}
Can anyone please help on this issue?

1 answer

0 votes
Tim Perrault
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.
July 26, 2023

Hi @Siva Barri 

 

It looks like the error message is saying the issue type Test is not a sub-task and you are trying to add a parent to it. 

 

Can you confirm that the Test issue type is a sub-task issue type?

Siva Barri July 26, 2023

@Tim Perrault If I give like below, I am able to create a sub-task to the parent ticket.

{
  "fields": {
    "project": {
      "key""PROJECT_KEY"
    },
    "parent": {
      "key""STORY_KEY"
    },
    "summary""QA Validation",
    "description""Functional Validation",
    "issuetype": {
      "id""5"
    }
  }
}

Question:

Do I need to create a sub-task and I need to create a test case against it?

Tim Perrault
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.
July 26, 2023

So the actual problem was you were trying to attach the test issue type as a sub-task. The Test issue type is what would be considered a "parent" issue. 

 

I'm not totally sure what you are trying to do though. Did you create the issue types or are they included with a plugin?

Siva Barri July 26, 2023

Hello @Tim Perrault , It is already there.

 

Can you please guide me, how to create a test case for a story in jira ? Any documentation and any example. Thanks

Tim Perrault
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.
July 26, 2023

Are you using a plugin for test cases?

Siva Barri July 26, 2023

Jira Zephyer, we are using to create a test cases.

Currently I am using postman for rest apis. So trying to explore options to create using Rest APIs

Tim Perrault
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.
July 26, 2023

Unfortunately I'm not really familiar with that app. I've added a tag to the question to get more eyes on it.

 

The only thing I can think of is Link the issues instead of creating a parent / child relationship

Suggest an answer

Log in or Sign up to answer