Forums

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

Creating subtask in a company managed project via REST fails, works with Team-Managed

Martin Kropp
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 9, 2023

Hi,

I try to create a subtask via REST API 2 on my cloud projects.

While it works well for my Team-Managed projects, I cannot create subtasks for company-managed projects.

Are there any limitations or differences between those two project types?
My payload looks as follows:
{'id': '', 'fields': {'project': {'key': 'CMTP'}, 'summary': 'Test Misc Issue - not to be seen after test', 'description': "if you see this the test didn't clean up properly", 'issuetype': {'name': 'Subtask'}, 'priority': {'id': '3'}, 'parent': {'id': '13191'}}}

Thanks a lot for your help.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
October 10, 2023

Hello @Martin Kropp 

Are you getting any sort of error message in response?

My first thought is that the name of the subtask issue type is different in your Company Managed project versus your Team Managed project.

In my Jira Cloud instance the default subtask issue type created in a Team Managed project is named "Subtask". But the default subtask issue type created for use in Company Managed projects is named "Sub-task" (with a hyphen).

Martin Kropp
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 10, 2023

Many thanks for the quick response.
OK. I understand the subtaks names differ for server projects (we still have some), and different cloud project types:
server projects: Sub-task
team managed projects: Subtask
company managed projects: Sub-task

What's the best way handle this?

Do I need the retrieve the names of the issue type by their id (which seems to be 10316) for cloud projects, independent of the project type?

I see the url = "https://your-domain.atlassian.net/rest/api/2/issuetype/{id}" is per domain, not per project.
How can I get an issuetype of a project, since subtask names differ per project type?
many thanks!


Bill Sheboy
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.
October 10, 2023

Hi @Martin Kropp 

Adding to Trudy's answer...

One way to do that is to get the metadata for the issue types in the specific project, confirming you have the correct id for the subtask type.  That is described here for the v3 of Create Issue: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post

Kind regards,
Bill

Like Martin Kropp likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events