Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Issue Type Scheme and Workflow Scheme for JIRA project using REST API

I'm doing an integration for JIRA using REST API 6.2.6. One thing that I need to do is to get Issue Type Scheme and Workflow Scheme for a project.

What I tried:

Issue Type Scheme

The only thing that I can get right now is a list of issue types using /rest/api/2/project/{projectIdOrKey}. I can't see any way of getting an ID of Issue Type Scheme. Looking at API there is no any endpoints for issue type schemes, so I guess it's not possible.

Workflow Scheme

/rest/api/2/project/{projectIdOrKey} doesn't return any information about Workflow Scheme. But there is an endpoint /rest/api/2/workflowscheme/{id}, so that means that it's possible to get ID somehow... At the end I want to get a list of workflows for a project to check transitions for an issue type.

Question

Is there any way to get the data I want? Maybe there is some hidden not documented API?

Note: I'm using only JIRA REST API.

like image 483
Aleksandr Ivanov Avatar asked Jun 25 '14 15:06

Aleksandr Ivanov


People also ask

What can be configured for the Jira project and issue type?

You can also configure the workflow, fields and screens for the issue type in the project, but it is easier to do this by clicking one of the issue types. One of the issue types (e.g. Bug, Task, Story): Click this to configure the workflow/screen for the issue type in the project.


1 Answers

Latest Jira documentation provides information about the APIs which can be used to fetch details for issuetype scheme and workflow scheme. Below are the APIs which can be used for the same,

  1. Fetching Issue type Scheme for a project Issuetype Scheme API

Rest URL:GET https://your-domain.atlassian.com/rest/api/2/issuetypescheme/project?projectId={projectId}'

Sample Response:

{
    "maxResults": 100,
    "startAt": 0,
    "total": 3,
    "isLast": true,
    "values": [
        {
            "issueTypeScheme": {
                "id": "10000",
                "name": "Default Issue Type Scheme",
                "description": "Default issue type scheme is the list of global issue types. All newly created issue types will automatically be added to this scheme.",
                "defaultIssueTypeId": "10003",
                "isDefault": true
            },
            "projectIds": [
                "10000",
                "10001"
            ]
        }
    ]
}
  1. Fetching workflow scheme configured for a project Workflow Scheme API

REST URl: GET https://your-domain.atlassian.com/rest/api/2/workflowscheme/{id}

Sample Response:

{
  "id": 101010,
  "name": "Example workflow scheme",
  "description": "The description of the example workflow scheme.",
  "defaultWorkflow": "jira",
  "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
  },
  "draft": false,
  "self": "https://your-domain.atlassian.net/rest/api/2/workflowscheme/101010"
}
like image 144
Vishal Kharde Avatar answered Sep 29 '22 01:09

Vishal Kharde