Hi Team.
I followed the Forge Feedback Collector Macro, but in my confluence, this doesn’t work properly.
export const fetchIssueTypes = async () => {
const response = await api.asApp().requestJira(route/rest/api/3/issuetype
);
const issueTypes = await response.json();
return issueTypes.filter((issueType) => !issueType.subtask);
};
Even though the issueTypes are array, but the .filter is not working, so I don’t know how to fix it. Is it related to any permission issue?
also, I got another error that .map is not a function, but the project is also array.
the current issue types
[
{
“self”: “https://sb-atlassian-dev.atlassian.net/rest/api/3/issuetype/10003”,
“id”: “10003”,
“description”: “A small piece of work that’s part of a larger task.”,
“iconUrl”: “subtask”,
“name”: “Sub-task”,
“untranslatedName”: “Sub-task”,
“subtask”: true,
“avatarId”: 10316,
“hierarchyLevel”: -1
},
{
“self”: “https://sb-atlassian-dev.atlassian.net/rest/api/3/issuetype/10001”,
“id”: “10001”,
“description”: “Functionality or a feature expressed as a user goal.”,
“iconUrl”: “story”,
“name”: “Story”,
“untranslatedName”: “Story”,
“subtask”: false,
“avatarId”: 10315,
“hierarchyLevel”: 0
},
{
“self”: “https://sb-atlassian-dev.atlassian.net/rest/api/3/issuetype/10002”,
“id”: “10002”,
“description”: “A small, distinct piece of work.”,
“iconUrl”: “task”,
“name”: “Task”,
“untranslatedName”: “Task”,
“subtask”: false,
“avatarId”: 10318,
“hierarchyLevel”: 0
},
{
“self”: “https://sb-atlassian-dev.atlassian.net/rest/api/3/issuetype/10004”,
“id”: “10004”,
“description”: “A problem or error.”,
“iconUrl”: “bug”,
“name”: “Bug”,
“untranslatedName”: “Bug”,
“subtask”: false,
“avatarId”: 10303,
“hierarchyLevel”: 0
},
{
“self”: “https://sb-atlassian-dev.atlassian.net/rest/api/3/issuetype/10000”,
“id”: “10000”,
“description”: “A big user story that needs to be broken down. Created by Jira Software - do not edit or delete.”,
“iconUrl”: “epic”,
“name”: “Epic”,
“untranslatedName”: “Epic”,
“subtask”: false,
“hierarchyLevel”: 1
}
]
the current projects
[
{
“expand”: “description,lead,issueTypes,url,projectKeys,permissions,insight”,
“self”: “https://sb-atlassian-dev.atlassian.net/rest/api/3/project/10001”,
“id”: “10001”,
“key”: “PT”,
“name”: “project TWO”,
“avatarUrls”:
{
“48x48”: “project_avatar_design”,
“24x24”: “project_avatar_design”,
“16x16”: “project_avatar_design”,
“32x32”: “project_avatar_design”
},
“projectTypeKey”: “software”,
“simplified”: false,
“style”: “classic”,
“isPrivate”: false,
“properties”:
{}
},
{
“expand”: “description,lead,issueTypes,url,projectKeys,permissions,insight”,
“self”: “https://sb-atlassian-dev.atlassian.net/rest/api/3/project/10000”,
“id”: “10000”,
“key”: “TES”,
“name”: “test1”,
“avatarUrls”:
{
“48x48”: “project_avatar_coffee”,
“24x24”: “project_avatar_coffee”,
“16x16”: “project_avatar_coffee”,
“32x32”: “project_avatar_coffee”
},
“projectTypeKey”: “software”,
“simplified”: false,
“style”: “classic”,
“isPrivate”: false,
“properties”:
{}
}
]