Hi @OndejMedek ,
I tried it, but it didnāt work either. In the āKanbanā project āstoryā issue type has Id 1001 and in the āScrumā project it has the Id 1005. I updated my demo project with:
const projectKey = context.platformContext.projectKey;
const responseGetProject = await api.asApp().requestJira(route`/rest/api/3/project/${projectKey}?expand=issueTypes`, {
headers: {
'Accept': 'application/json'
}
});
const jsonGetProject = await responseGetProject.json();
const issueType = jsonGetProject.issueTypes.find(issueType => issueType.name == "Story");
var bodyData = {
"fields": {
"summary": "Test",
"project": {
"key": projectKey
},
"issuetype": {
"id": issueType.id
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Test description",
"type": "text"
}
]
}
]
},
"labels": [
"testlabel"
]
}
};
const response = await api.asApp().requestJira(route`/rest/api/3/issue`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(bodyData)
});
If I query a issue which was created via UI, I receive the following JSON response, which does also contain the 3 fields:
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_10010.requestTypePractice",
"id": "10013",
"self": "replaced",
"key": "COD-1",
"fields": {
"statuscategorychangedate": "2021-09-11T21:18:12.052+0000",
"issuetype": {
"self": "replaced",
"id": "10005",
"description": "Stories track functionality or features expressed as user goals.",
"iconUrl": "replaced",
"name": "Story",
"subtask": false,
"avatarId": 10315,
"entityId": "a4aacffa-7c0e-404b-b3e1-f384bd12024f",
"hierarchyLevel": 0
},
"timespent": null,
"project": {
"self": "replaced",
"id": "10001",
"key": "COD",
"name": "Codegeist2021",
"projectTypeKey": "software",
"simplified": true,
"avatarUrls": {
"48x48": "replaced",
"24x24": "replaced",
"16x16": "replaced",
"32x32": "replaced"
}
},
"fixVersions": [],
"aggregatetimespent": null,
"resolution": null,
"customfield_10027": null,
"customfield_10028": null,
"customfield_10029": null,
"resolutiondate": null,
"workratio": -1,
"issuerestriction": {
"issuerestrictions": {},
"shouldDisplay": false
},
"lastViewed": null,
"watches": {
"self": "replaced",
"watchCount": 1,
"isWatching": false
},
"created": "2021-09-11T21:18:11.803+0000",
"customfield_10020": null,
"customfield_10021": null,
"customfield_10022": null,
"customfield_10023": null,
"priority": {
"self": "replaced",
"iconUrl": "replaced",
"name": "Medium",
"id": "3"
},
"customfield_10024": null,
"customfield_10025": null,
"labels": [
"technicaldebt"
],
"customfield_10026": [],
"customfield_10016": null,
"customfield_10017": null,
"customfield_10018": {
"hasEpicLinkFieldDependency": false,
"showField": false,
"nonEditableReason": {
"reason": "PLUGIN_LICENSE_ERROR",
"message": "The Parent Link is only available to Jira Premium users."
}
},
"customfield_10019": "0|i0002v:",
"aggregatetimeoriginalestimate": null,
"timeestimate": null,
"versions": [],
"issuelinks": [],
"assignee": null,
"updated": "2021-09-11T21:46:17.938+0000",
"status": {
"self": "replaced",
"description": "",
"iconUrl": "replaced",
"name": "To Do",
"id": "10002",
"statusCategory": {
"self": "replaced",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"components": [],
"timeoriginalestimate": null,
"description": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "test"
}
]
}
]
},
"customfield_10010": null,
"customfield_10014": null,
"timetracking": {},
"customfield_10015": null,
"customfield_10005": null,
"customfield_10006": null,
"security": null,
"customfield_10007": null,
"customfield_10008": null,
"aggregatetimeestimate": null,
"customfield_10009": null,
"attachment": [],
"summary": "check",
"creator": {
"self": "replaced",
"accountId": "557058:4f04523f-b8a2-47a7-9198-25c71fb7f924",
"avatarUrls": {
"48x48": "replaced",
"24x24": "replaced",
"16x16": "replaced",
"32x32": "replaced"
},
"displayName": "Sven Lauterbach",
"active": true,
"timeZone": "Etc/GMT",
"accountType": "atlassian"
},
"subtasks": [],
"reporter": {
"self": "replaced",
"accountId": "557058:4f04523f-b8a2-47a7-9198-25c71fb7f924",
"avatarUrls": {
"48x48": "replaced",
"24x24": "replaced",
"16x16": "replaced",
"32x32": "replaced"
},
"displayName": "Sven Lauterbach",
"active": true,
"timeZone": "Etc/GMT",
"accountType": "atlassian"
},
"customfield_10000": "{}",
"aggregateprogress": {
"progress": 0,
"total": 0
},
"customfield_10001": null,
"customfield_10002": null,
"customfield_10003": null,
"customfield_10004": null,
"environment": null,
"duedate": null,
"progress": {
"progress": 0,
"total": 0
},
"comment": {
"comments": [],
"self": "replaced",
"maxResults": 0,
"total": 0,
"startAt": 0
},
"votes": {
"self": "replaced",
"votes": 0,
"hasVoted": false
},
"worklog": {
"startAt": 0,
"maxResults": 20,
"total": 0,
"worklogs": []
}
}
}
So at this point I donāt know, what else I could try.