I`ve created new service project on my site, then I`ve created two issues - Task and [System] Service request. In my app I try to display issue types icons and for Service request I can not get icon due to permissions problems.
Here is my code:
const response = await api.asApp().requestJira(route`/rest/api/3/issuetype`, {
@Salih Tuç Thank you for response! I`ve tried to add read:issue-type:jira
, read:avatar:jira
, read:project-category:jira
permissions, but this didn`t help.
And here is full response for icons that are not displaying:
{
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: Gunzip {
_writeState: [Uint32Array],
_events: [Object],
_readableState: [ReadableState],
_writableState: [WritableState],
allowHalfOpen: true,
_maxListeners: undefined,
_eventsCount: 5,
bytesWritten: 0,
_handle: [Zlib],
_outBuffer: <Buffer 7b 22 65 72 72 6f 72 4d 65 73 73 61 67 65 73 22 3a 5b 22 59 6f 75 20 64 6f 20 6e 6f 74 20 68 61 76 65 20 70 65 72 6d 69 73 73 69 6f 6e 20 74 6f 20 76 ... 16334 more bytes>,
_outOffset: 0,
_chunkSize: 16384,
_defaultFlushFlag: 2,
_finishFlushFlag: 2,
_defaultFullFlushFlag: 3,
_info: undefined,
_maxOutputLength: 4294967296,
_level: -1,
_strategy: 0,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null,
[Symbol(kError)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://api.atlassian.com/ex/jira/6d1d11a0-3926-4f1d-ba96-b0bf0a4a1c4d/rest/api/2/universal_avatar/view/type/issuetype/avatar/10564?size=medium',
status: 403,
statusText: 'Forbidden',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}
Hi @Iryna Balandiukh , welcome to the Community!
I think your code is correct to get the data. If you are getting 403, it is probably getting while accessing the iconUrl for Service request.
Since this is a "System" issue type, maybe you need some granular access (that you can see from API documentation), i.e read:avatar:jira in your manifest. Can you try it by adding this to your scopes?
And also, for both requests, can you also log/print the error message in the response? If it is returning 403, the REST API is probably returning a response that contains an errorMessage, which states a useful information about the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for response! I`ve tried to add next permissions:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for response! I`ve tried to add read:issue-type:jira
, read:avatar:jira
, read:project-category:jira
permissions, but this didn`t help.
And here is full response for icons that are not displaying:
{
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: Gunzip {
_writeState: [Uint32Array],
_events: [Object],
_readableState: [ReadableState],
_writableState: [WritableState],
allowHalfOpen: true,
_maxListeners: undefined,
_eventsCount: 5,
bytesWritten: 0,
_handle: [Zlib],
_outBuffer: <Buffer 7b 22 65 72 72 6f 72 4d 65 73 73 61 67 65 73 22 3a 5b 22 59 6f 75 20 64 6f 20 6e 6f 74 20 68 61 76 65 20 70 65 72 6d 69 73 73 69 6f 6e 20 74 6f 20 76 ... 16334 more bytes>,
_outOffset: 0,
_chunkSize: 16384,
_defaultFlushFlag: 2,
_finishFlushFlag: 2,
_defaultFullFlushFlag: 3,
_info: undefined,
_maxOutputLength: 4294967296,
_level: -1,
_strategy: 0,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null,
[Symbol(kError)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://api.atlassian.com/ex/jira/6d1d11a0-3926-4f1d-ba96-b0bf0a4a1c4d/rest/api/2/universal_avatar/view/type/issuetype/avatar/10564?size=medium',
status: 403,
statusText: 'Forbidden',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Salih Tuç Thank you for response! I`ve tried to add read:issue-type:jira
, read:avatar:jira
, read:project-category:jira
permissions, but this didn`t help.
And here is full response for icons that are not displaying:
{
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: Gunzip {
_writeState: [Uint32Array],
_events: [Object],
_readableState: [ReadableState],
_writableState: [WritableState],
allowHalfOpen: true,
_maxListeners: undefined,
_eventsCount: 5,
bytesWritten: 0,
_handle: [Zlib],
_outBuffer: <Buffer 7b 22 65 72 72 6f 72 4d 65 73 73 61 67 65 73 22 3a 5b 22 59 6f 75 20 64 6f 20 6e 6f 74 20 68 61 76 65 20 70 65 72 6d 69 73 73 69 6f 6e 20 74 6f 20 76 ... 16334 more bytes>,
_outOffset: 0,
_chunkSize: 16384,
_defaultFlushFlag: 2,
_finishFlushFlag: 2,
_defaultFullFlushFlag: 3,
_info: undefined,
_maxOutputLength: 4294967296,
_level: -1,
_strategy: 0,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null,
[Symbol(kError)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://api.atlassian.com/ex/jira/6d1d11a0-3926-4f1d-ba96-b0bf0a4a1c4d/rest/api/2/universal_avatar/view/type/issuetype/avatar/10564?size=medium',
status: 403,
statusText: 'Forbidden',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, the value of iconUrl seems different. As I saw from the URL, the avatar id is 10564. Can you please try to request following link:
https://<your-domain.atlassian.net>/secure/viewavatar?size=xsmall&avatarId=10564&avatarType=issuetype
Is it returning something meaningful?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.