Hi @sushilb,
I was able to successfully create a new issue using a new issue type I created.
Here are the steps I did in the UI:
- Created the new issue type in the Issue Type screen
- Associated the new issue type with an issue type scheme for project with key TEST and id
10000
To create the issue via API call:
- To ensure that I can create an issue in the specified project, I called Get create issue metadata →
GET /rest/api/3/issue/createmeta?projectKeys=TEST
which gives me a response like this:
{
"expand": "projects",
"projects":
[
{
"self": "https://iragudo.atlassian.net/rest/api/3/project/10000",
"id": "10000",
"key": "TEST",
"name": "Test",
"avatarUrls":
{
"48x48": "https://iragudo.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413",
"24x24": "https://iragudo.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=small",
"16x16": "https://iragudo.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=xsmall",
"32x32": "https://iragudo.atlassian.net/rest/api/3/universal_avatar/view/type/project/avatar/10413?size=medium"
},
"issuetypes":
[
{
"self": "https://iragudo.atlassian.net/rest/api/3/issuetype/10002",
"id": "10002",
"description": "A small, distinct piece of work.",
"iconUrl": "https://iragudo.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium",
"name": "Task",
"untranslatedName": "Task",
"subtask": false
},
...
{
"self": "https://iragudo.atlassian.net/rest/api/3/issuetype/10016",
"id": "10016",
"description": "",
"iconUrl": "https://iragudo.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10300?size=medium",
"name": "Custom Ian Issue Type",
"untranslatedName": "Custom Ian Issue Type",
"subtask": false
}
]
}
]
}
- Now that I’m sure the issue type is associated with the project, I now call the Create issue API with this body:
{
"fields": {
"description": {
"content": [
{
"content": [
{
"text": "This is created via API",
"type": "text"
}
],
"type": "paragraph"
}
],
"type": "doc",
"version": 1
},
"issuetype": {
"id": "10016"
},
"labels": [
"test"
],
"project": {
"id": "10000"
},
"summary": "API TEST Custom Issue Type"
},
"update": {}
}
With the above-mentioned steps, I was able to successfully create an issue.
Can you share your Create issue REST API call’s request body so we can verify that the necessary issue type field was supplied?
Hope this helps,
Ian