Jira Api: "story" issuetype for my project created via REST call not permitted

I am using Jira 3LO to access Jira API. I was able to create a project using the endpoint: rest/api/3/project/
I used the following properties:

const bodyData = {
            assigneeType: 'UNASSIGNED', // other value is  'PROJECT_LEAD'
            description: 'My Project 1',
            issueSecurityScheme: 10001,
            key: 'P1',
            leadAccountId: leadAccountId, 
            name: 'Project 1',
            notificationScheme: 10000, 
            permissionScheme: 0, 
            projectTemplateKey: 'com.pyxis.greenhopper.jira:gh-simplified-agility-kanban', 
            projectTypeKey: 'software',
            url: 'http://atlassian.com',
        };

My project was generated with the id 10003. When I call the issue type endpoint rest/api/3/issuetype, I get a list of issue types. It appears that most issues types have a scope and project id associated with them. These ids correlate to other projects that I created not via the api, but through the Jira application. One of those issue types has a scope id 10003 and a name of ‘Task’. When I try to create an issue with that issuetype’s id, the issue is created. When I try to create an issue with an issuetype that has the name ‘Story’ it fails. None of the Story issuetypes have my 10003 project id for the scope and none of them work when I try to create an issue. Here are the parameters I use to create my issue:

{
    fields: {
        issuetype: {
            id: '10015', // The only one that would work
        },
        summary: activityName,
        project: {
            id: 10003,
        },
        assignee: {
            id: assigneeId,
        },
        reporter: {
            id: assigneeId,
        }
    },
}; 

Right now I am only able to create Tasks. How do I create a Story? Did I not set my project up correctly? Are there parameters that I am missing or are wrong?

Hi,

I see your point here and I can confirm that what you are reporting is the current behaviour.

Let me add a bit more context here.

When using the following in the payload:

"projectTemplateKey": "com.pyxis.greenhopper.jira:gh-simplified-agility-kanban",

This is creating a team-managed project:
image

At this stage, team-managed projects are not associated with an issue scheme in the same way as company-managed projects so it’s not possible to do that via the REST API either.

From the UI, it’s possible to add the Story issueType to this project:


However, there is no REST API for that and I could find this open request for this: [JSWCLOUD-23545] API call to update / create issue types in a Team Managed Project - Create and track feature requests for Atlassian products.

So here are a few of the available options for this scenario:

  • use a different projectTemplate
  • update the issue types for the project via the UI

This page provides a high-level description of the differences between team and company-managed projects if you want to have a look.

Hope this brings some more clarity about this topic,
Caterina

This is exactly the info I need. Thank you so much! As a follow up, could you give an alternative to using the project template: “projectTemplateKey”: “com.pyxis.greenhopper.jira:gh-simplified-agility-kanban”?

Hi @AaronFriedman1,

Hard to tell which project would be best here but there are a few options I can suggest for you to decide on:

  • create a project using the UI following the prompts and check in the browser Developer Tools which template is used. You’ll see a request like this:
  • try creating the projects using the templates available here. There aren’t details about what each template corresponds to but you’ll then be able to check it in the UI.

In case it helps, the project that I’ve created using via the UI uses the com.pyxis.greenhopper.jira:gh-simplified-kanban-classic template and has a Task option as Issue Type.

Caterina

1 Like