-
Type:
Bug
-
Resolution: Timed out
-
Priority:
Medium
-
Component/s: Work Item - View (Internal developer use only)
-
Severity 2 - Major
Summary
When trying to get context parameters thru AP.context.getContext(), no response is returned immediately. Repeating calls were made to AP.context one per 5 seconds. First several results didn't have the issue key, and context was an empty object. Issue key appeared after 30 seconds only:
API is invoked when frame is loaded an script starts working:
export function getIssueKey() {
return new Promise((resolve, reject) =>{
try {
AP.context.getContext(
context => {
const issueKey = access('jira.issue.key', context)
if (issueKey) {
// console.log('issue key is resolved', issueKey)
resolve(issueKey)
} else {
//console.log('issue key is not resolved', context)
// I noticed that context is an empty object in this case,
// try to get issueKey from URL parameters:
const params = getQueryParams(location.search)
resolve(params['issue.key'])
}
}
)
} catch(e) {
reject(e)
}
})
}
Notes
- Works in old issue view
- iframe is nor cacheable
- Not sure if this is by design
- relates to
-
DEVHELP-1746 Loading...